home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2007-11-29 | 217.2 KB | 5,017 lines
// MFindItemByIndex // JavaScript Document // ---------------------------------------------------------------- // Constants: // ---------------------------------------------------------------- CONST_ERR_QUESTION = 6000; CONST_MSG_STATE_EXCLUDED = '6E79535F534953557178456D65744963'; CONST_CID = '44D6005D4449435BBBF419FDC8367C08'; CONST_WIN_NO_SYNC = '535F4F4E5F4E49570000000000434E59'; CONST_WIN_DEL_SYNC = '4F4D45525F4E495700004C4C415F4556'; // WIN_REMOVE_ALL CONST_ACTION_STATE_INIT = '535F4E4F49544341614E495F45544154'; CONST_ACTION_STATE_IN_PROGRESS = '535F4E4F495443415A4E495F45544154'; CONST_ACTION_STATE_DONE = '535F4E4F49544341574F445F45544154'; CONST_AssocTemplate = ''; CONST_MESSAGES_ON_PAGE = 10; CONST_ShowFullFileName = true; // Status attribute definitions. STATUS_ATTRIBUTE_AUTOMATIC = 1; STATUS_ATTRIBUTE_AUTOMATIC_INTERNAL = 2; STATUS_ATTRIBUTE_AUTOMATIC_DISABLED = 3; STATUS_ATTRIBUTE_ANALYZING = 4; STATUS_ATTRIBUTE_SYNCHRONIZING = 5; STATUS_ATTRIBUTE_INFORMATION_MESSAGE = 6; STATUS_ATTRIBUTE_IMPORTANT_MESSAGE = 7; STATUS_ATTRIBUTE_INCOMPLETE = 8; STATUS_ATTRIBUTE_ANALYZE_ENABLED = 9; STATUS_ATTRIBUTE_SYNCHRONIZE_ENABLED = 10; STATUS_ATTRIBUTE_STOP_ENABLED = 11; // ---------------------------------------------------------------- // Global variables: // ---------------------------------------------------------------- G_OnProfileChanged_called = false; G_OnAssocChanged_called = false; G_CounterRefreshFlag = false; G_AnalyzeHintCallCounter = 4; G_Folders_is_ready = false; G_OnDirectionChanged = false; G_filter_switched = false; //G_SynchronizeHintCallCounter = 3; G_TabScrollingProcessNum = 0; G_ActiveAssocID = ''; G_Assocs = {}; //new Array(); G_ProfileExist = false; G_FirstAssocID = ''; Flag_can_reload_profile = true; G_Shown_message = {}; G_Shown_message.msg_id = null; G_Shown_message.collection_id = null; G_Collection_lock = false; // ---------------------------------------------------------------- // Settings of middle message (Above_message) // ---------------------------------------------------------------- G_Above_message = {}; G_Above_message.msg_id = null; G_Above_message.collection_id = null; G_Above_message.mustshown = true; G_Above_message.latch = false; // ---------------------------------------------------------------- G_Caption_menu = false; G_Caption_menu_mustshown = false; G_Caption_menu_above = false; G_FocusInCaptionMenu = false; G_AssocChangedCause = ''; G_Block = false; G_DEBUG = false; G_debug_line_number = 1; // ---------------------------------------------------------------- // End of global variables definitions // ---------------------------------------------------------------- function Body_onload() { ApplicationName.innerText = external.GetAppName(); //ApplicationName.innerHTML = '<span><img style="position:relative; top:4px; left:-15px;" src="Pics/Logotype.png"></span>' + //external.GetAppName() + ' ' + //'<span style="color:#414c32; font-size:18px;">' + // external.LS("banner_version")+' '+ external.GetAppVersionUserStr()+ //'</span>'; BannerSlogan.innerText = external.LS("banner_slogan"); VersionInBanner.innerHTML = external.LS("banner_version")+' '+external.GetAppVersionUserStr(); //external.LS("banner_version") Select_sync_direction.innerHTML = external.LS("popup_select_direction"); If_remove_check_lbl.innerText = external.LS("check_remove_files"); If_remove_check_div.title = external.LS("hint_check_remove_files"); If_rewrite_check_lbl.innerText = external.LS("check_overwrite_files"); If_rewrite_check_div.title = external.LS("hint_check_overwrite_files"); Change_link.innerText = external.LS("popup_change_link"); Change_link.title = external.LS("tooltip_change_link"); AllWayRadio.title = external.LS('tooltip_all_way_sync'); CONST_AssocTemplate = AssocTemplate.innerHTML; CONST_MESSAGES_ON_PAGE = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); CONST_ShowFullFileName = external.Method1('M_GetGlobalOption', 'ShowFullFileName'); var State = external.Method1('M_GetGlobalOption', 'ShowBanner'); ExtChangeBannerState(State); //------------------------------------------------------------ var ActiveAssocObj = external.Method0('M_GetSelectedAssoc'); G_ActiveAssocID = ActiveAssocObj.objID; //------------------------------------------------------------ LoadProfile(); ActivateAssoc(G_ActiveAssocID); UpdateButtons(G_ActiveAssocID); var AssocObj = external.ObjByID(G_ActiveAssocID); var Status = AssocObj.Method0('M_GetAggregatedGeneralStatus'); UpdateAssocStatus(G_ActiveAssocID, Status); ResizeWindow(); initDHTMLAPI(); initDrag(); } function LoadProfile() { //--------------------------------------------------- G_ProfileExist = false; var profile = external.Method0Own('M_GetProfile'); if (profile == null) return G_ProfileExist; else G_ProfileExist = true; //--------------------------------------------------- var Assocs_exist = false; var AssocObj = profile.GetFirst(); if(AssocObj == null) return Assocs_exist; else Assocs_exist = true; //--------------------------------------------------- var ActiveAssoc_exist = false; var FirstAssocID = AssocObj.objID; // show all assocs from Profile while(AssocObj != null) { if(G_ActiveAssocID == AssocObj.objID) ActiveAssoc_exist = true; AddAssoc(AssocObj); var AssocObj = profile.GetNext(AssocObj); } //---------------------------------------------------------- var ActiveAssocObj = external.Method0('M_GetSelectedAssoc'); if (ActiveAssocObj) { G_ActiveAssocID = ActiveAssocObj.objID; ActiveAssoc_exist = true; } //---------------------------------------------------------- if(ActiveAssoc_exist != true) G_ActiveAssocID = FirstAssocID; return Assocs_exist; } // -------------------------------------------------------------------- // initialisation of association // -------------------------------------------------------------------- function InitAssoc(AssocObj) { var AssocID = AssocObj.objID; // ----------------------------------------------------------------------------------------------- G_Assocs[AssocID]={}; G_Assocs[AssocID].self=AssocID; G_Assocs[AssocID].Folders_is_ready = false; G_Assocs[AssocID].FoldersQuantity = 2; G_Assocs[AssocID].WinningSuperTreeID = CONST_CID; // For one/all way synchronization switch G_Assocs[AssocID].Folder_is_ready_array = new Array(); G_Assocs[AssocID].OnAssocChangedCalled = false; G_Assocs[AssocID].TreeView = new CreateTree(AssocID, "tree","TreeView_element"); G_Assocs[AssocID].CollectionNodesExist = false; // ----------------------------------------------------------------------------------------------- AssocElement = document.getElementById('Assoc_'+AssocID); AssocElement.all['B_ANALYZE'].innerText = external.LS("button_analyze"); AssocElement.all['B_ANALYZE'].title = external.LS("tooltip_Analyze_button"); AssocElement.all['B_ANALYZE'].association_id = AssocID; AssocElement.all['B_SYNC'].innerText = external.LS("button_synchronize"); AssocElement.all['B_SYNC'].title = external.LS("tooltip_Sinchronize_button"); AssocElement.all['B_SYNC'].association_id = AssocID; AssocElement.all['B_STOP'].innerText = external.LS("button_clear"); AssocElement.all['B_STOP'].title = external.LS("tooltip_Stop_button"); AssocElement.all['B_STOP'].association_id = AssocID; AssocElement.all['Important_warning_text'].innerText = external.LS("important_warning"); AssocElement.all['Important_warning'].title = external.LS("tooltip_Important_warning"); // ----------------------------------------------------------------------------------------------- } function NewAssoc() { DeactivateAssoc(G_ActiveAssocID); // Deactivate current association solution = external.method0Own('M_GetDoProfileSyncSolution'); // Get solution Flag_can_reload_profile = false; // Lock ability to reload profile AssocObj = solution.Method0('M_CreateAssocW2Trees'); // Create association with two trees AssocObj.Method0('M_CreateNewSyncTreeInAssoc'); // Create new sync tree Flag_can_reload_profile = true; // Unlock ability to reload profile AddAssoc(AssocObj); // Set assoc by default and redraw it ActivateAssoc(AssocObj.objID); // make assoc as current and activate it } // ----------------------------------------------------------------------------------------------------------- // AddAssoc(AssocObj) Create assoc label // Add html object for assoc, // Call InitAssoc(AssocObj) - set html assoc object by default // LoadAssocPaths(AssocID) - place rootfolders objects to assoc // G_Assocs[AssocID].TreeView.redraw() - redraw all collections // // association to assoc tree, set assoc by default and redraw it // ----------------------------------------------------------------------------------------------------------- function AddAssoc(AssocObj) { //----------------------------- var AssocID = AssocObj.objID; //----------------------------- if(TabsLabels.cells.length == 1) { LeftSeparatorCell = TabsLabels.insertCell(0); LeftSeparatorCell.height = '26px'; LeftSeparatorCell.className = 'TabSeparatorCell'; LeftSeparatorCell.innerHTML = '<div class="TabSeparator_3">'; } else { LeftSeparatorCell = TabsLabels.cells(TabsLabels.cells.length-2); LeftSeparatorCell.children[0].className = 'TabSeparator_7'; } NewLabelCell = TabsLabels.insertCell(TabsLabels.cells.length-1); NewLabelCell.id = 'Label_'+AssocID; NewLabelCell.style.backgroundImage = "url('Pics/TabCaptionMid1.gif')"; NewLabelCell.style.cursor = "hand"; NewLabelCell.noWrap = true; //--------------------------------------------------------------------------------------------------- var status = AssocObj.Method0('M_GetAggregatedGeneralStatus'); var status_src = 'Pics/Status_normal.gif'; //--------------------------------------------------------------------------------------------------- if (status == 0) status_src = 'Pics/Status_normal.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC) status_src = 'Pics/Status_schedule.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC_INTERNAL) status_src = 'Pics/Status_schedule.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC_DISABLED) status_src = 'Pics/Status_manual.gif'; else if (status == STATUS_ATTRIBUTE_ANALYZING) status_src = 'Pics/Status_analyze.gif'; else if (status == STATUS_ATTRIBUTE_SYNCHRONIZING) status_src = 'Pics/Status_synchronize.gif'; else if (status == STATUS_ATTRIBUTE_INFORMATION_MESSAGE)status_src = 'Pics/Status_information.gif'; else if (status == STATUS_ATTRIBUTE_IMPORTANT_MESSAGE) status_src = 'Pics/Status_important.gif'; else if (status == STATUS_ATTRIBUTE_INCOMPLETE) status_src = 'Pics/Status_incomplete.gif'; //--------------------------------------------------------------------------------------------------- NewLabelCell.innerHTML = '<div oncontextmenu="TabLabelContextMenu(\''+AssocID+'\')" '+ 'onclick="TabLabelOnClick1(\''+AssocID+'\')" '+ 'style="position:relative: top:0px; left:0px; width:100%; height:26px; padding-top:3px;">'+ '<img id="Status_img" src="'+status_src+'" '+ 'style="position:relative; top:2px; left:0px; margin-right:3px; margin-left:-3px;">'+ '<span tabindex="1" onkeypress="TabLabelOnClick1(\''+AssocID+'\')" id="TabCaptionText">'+ AssocObj.Method0('M_GetAssocName')+'</span><div>'; RightSeparatorCell = TabsLabels.insertCell(TabsLabels.cells.length-1); RightSeparatorCell.className = 'TabSeparatorCell'; RightSeparatorCell.height = '26px'; RightSeparatorCell.innerHTML = '<div class="TabSeparator_4">'; TabsCaptionResized(); //--------------------------------------------------------------------------------------------------- AssocsContainer.innerHTML = AssocsContainer.innerHTML + '<div id="Assoc_'+AssocID+'" '+ 'oncontextmenu="TabLabelContextMenu(\''+AssocID+'\')" '+ 'style="position:absolute; width:100%; height:100%; visibility:hidden;">'+ CONST_AssocTemplate+'</div>'; InitAssoc(AssocObj); LoadAssocPaths(AssocID); G_Assocs[AssocID].TreeView.redraw(); var El = document.getElementById('Assoc_'+AssocID); El.style.display='none'; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function RemoveAllAssocsFromScreen() { Hint_window.style.visibility = 'hidden'; var AssocQuantity = AssocsContainer.children.length; for(var i=0; i<AssocQuantity; i++) { var AssocElement = AssocsContainer.children(0); var AssocID = AssocElement.id.replace(/Assoc_/,""); delete G_Assocs[AssocID]; AssocElement.removeNode(true); var LeftSeparatorCell = TabsLabels.cells(0); var LabelCell = TabsLabels.cells(1); TabsLabels.deleteCell(LeftSeparatorCell.cellIndex); TabsLabels.deleteCell(LabelCell.cellIndex); } if(AssocQuantity > 0) { var LastSeparatorCell = TabsLabels.cells(0); TabsLabels.deleteCell(LastSeparatorCell.cellIndex); } TabsCaptionResized(); } // -------------------------------------------------------------------------- // functions for deactivation of specified accosiation // -------------------------------------------------------------------------- function DeactivateAssoc(AssocID) { var AssocElement = document.getElementById('Assoc_'+AssocID); for(i=0; i<G_Assocs[AssocID].FoldersQuantity; i++) //Deactivate_form(i, AssocID); { ExtCloseHint(AssocID, "Syncpath_hint_"+i); //---------------------------------------------- SyncTree_elem = AssocElement.all["SyncTree"+i]; SyncTree_elem.className = "Unactive_panel"; //---------------------------------------------- Form_elem = AssocElement.all["TreeForm"+i]; if(Form_elem.is_changed == "true") ChangeSyncTree(num); } //--------------------------------------------------------------------- AssocElement.style.visibility = 'hidden'; AssocElement.style.display = 'none'; //--------------------------------------------------------------------- var FirstLabelIndex = 1; var LastLabelIndex = TabsLabels.cells.length - 3; //--------------------------------------------------------------------- var LabelCell = TabsLabels.cells['Label_'+AssocID]; var LabelCellIndex = LabelCell.cellIndex; var LeftSeparatorCell = TabsLabels.cells(LabelCellIndex-1); var RightSeparatorCell = TabsLabels.cells(LabelCellIndex+1); LabelCell.style.backgroundImage = "url('Pics/TabCaptionMid1.gif')"; //--------------------------------------------------------------------- LeftSeparatorCell.children(0).className = 'TabSeparator_7';// Unactive/Unactive RightSeparatorCell.children(0).className = 'TabSeparator_7';// Unactive/Unactive if (LabelCellIndex == FirstLabelIndex) LeftSeparatorCell.children(0).className = 'TabSeparator_3';// Empty/Unactive else if (LabelCellIndex == LastLabelIndex) RightSeparatorCell.children(0).className = 'TabSeparator_4';// Unactive/Empty } // ------------------------------------------------------------------------- function Deactivate_form(num, AssocID) { ExtCloseHint(AssocID, "Syncpath_hint_"+num); AssocElement = document.getElementById('Assoc_'+AssocID); SyncTree_elem = AssocElement.all["SyncTree"+num]; Form_elem = AssocElement.all["TreeForm"+num]; if(Form_elem.is_changed == "false") { SyncTree_elem.className = "Unactive_panel"; } else if(SyncTree_elem.contains(window.event.toElement) == false) { SyncTree_elem.className = "Unactive_panel"; ChangeSyncTree(num); } } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function ActivateAssoc(AssocID) { var AssocElement = document.getElementById('Assoc_'+AssocID); if(AssocElement == null) return; //------------------------------------------ AssocElement.style.display = ''; AssocElement.style.visibility = 'visible'; //------------------------------------------ var LastLabelIndex = TabsLabels.cells.length - 3; var FirstLabelIndex = 1; var LabelCell = TabsLabels.cells['Label_'+AssocID]; var LabelCellIndex = LabelCell.cellIndex; var LeftSeparatorCell = TabsLabels.cells(LabelCellIndex-1); var RightSeparatorCell = TabsLabels.cells(LabelCellIndex+1); LabelCell.style.backgroundImage = "url('Pics/TabCaptionMid2.gif')"; //------------------------------------------ LeftSeparatorCell.children(0).className = 'TabSeparator_5'; // Unactive/Active RightSeparatorCell.children(0).className = 'TabSeparator_6'; // Active/Unactive if(LabelCellIndex == FirstLabelIndex) LeftSeparatorCell.children(0).className = 'TabSeparator_1'; // Empty/Active if(LabelCellIndex == LastLabelIndex) RightSeparatorCell.children(0).className = 'TabSeparator_2'; // Active/Empty external.Method1('M_SelectAssoc', external.ObjByID(AssocID)); G_ActiveAssocID = AssocID; if (G_Assocs[AssocID].CollectionNodesExist == false) { G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_UserMessagesImportant'),'Important', external.LS('MM_UserMessagesImportant')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_UserMessagesInformation'),'Information', external.LS('MM_UserMessagesInformation')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_SyncItemQuestionable'), 'Questionable', external.LS('MM_SyncItemQuestionable')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'USIS_SyncItemDeleted'), 'Deleted', external.LS('USIS_SyncItemDeleted')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'USIS_SyncItemNew'), 'New', external.LS('USIS_SyncItemNew')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'USIS_SyncItemChanged'), 'Changed', external.LS('USIS_SyncItemChanged')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'USIS_SyncItemUnchanged'), 'Unchanged', external.LS('USIS_SyncItemUnchanged')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_SyncItemsAll'), 'All', external.LS('MM_SyncItemsAll')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'USIS_SyncItemExcluded'), 'Excluded', external.LS('USIS_SyncItemExcluded')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_OverwriteByUser'), 'OverwriteByUser', external.LS('MM_OverwriteByUser')); G_Assocs[AssocID].TreeView.add_collection_node(external.CreateUserMessageCollection(AssocID,'MM_SyncFindItems'), 'SyncFindItems', external.LS('MM_SyncFindItems')); G_Assocs[AssocID].CollectionNodesExist = true; } ScrollTabLabelIntoView(AssocID); LoadAssocPaths(AssocID); G_Assocs[AssocID].TreeView.redraw(); // !!! added because of replacing of collection nodes creating UpdateButtons(AssocID); ExtCountersRefresh(); ExtUpdateProgressBar(AssocID, external.Method0('M_GetProgressState'), external.Method0('M_GetProgressPercent')); // New !! } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function ExtOnAssocChanged(AssocID) { var d = new Date(); if(Flag_can_reload_profile == false) { return; } var AssocObj = external.ObjByID(AssocID); if((G_AssocChangedCause == 'Propagate_set') && (AssocID == G_ActiveAssocID)) { If_remove_check.checked = AssocObj.Method0('M_GetMimicDeleted'); If_rewrite_check.checked = AssocObj.Method0('M_GetMimicChanged'); return; } if(G_AssocChangedCause == 'SyncDirectionChanged') { if(AssocID == G_ActiveAssocID) { If_remove_check.checked = AssocObj.Method0('M_GetMimicDeleted'); If_rewrite_check.checked = AssocObj.Method0('M_GetMimicChanged'); } var SyncDirection = AssocObj.Method0('M_GetSyncDirection'); if((typeof(SyncDirection) == 'string') && (SyncDirection == external.AbbrToHex('DIRECTION_ALL_WAY'))) { G_Assocs[AssocID].WinningSuperTreeID = CONST_CID; var NewWinningSuperTreeID = 'DIRECTION_ALL_WAY'; } else { G_Assocs[AssocID].WinningSuperTreeID = SyncDirection.objID; var NewWinningSuperTreeID = SyncDirection.objID; } SwitchSyncDirectionArrow(AssocID, NewWinningSuperTreeID); return; } var LabelText = TabsLabels.cells['Label_'+AssocID].all['TabCaptionText']; LabelText.innerText = AssocObj.Method0('M_GetAssocName'); G_Assocs[AssocID].OnAssocChangedCalled = true; if(LoadAssocPaths(AssocID) == true) { if((G_AnalyzeHintCallCounter > 0) && (G_OnDirectionChanged == false) && (G_filter_switched == false)) { var AssocElement = document.getElementById('Assoc_'+AssocID); if((AssocElement != null) && (!AssocElement.all['B_ANALYZE'].disabled)) { ExtGiveHint(AssocID, "Analyze_hint"); G_AnalyzeHintCallCounter--; } } if(AssocID == G_ActiveAssocID && (G_filter_switched == false)) { setTimeout("FocusToAnalyze('"+AssocID+"')", 0); } G_filter_switched = false; } } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function FocusToAnalyze(AssocID) { if(AssocID != G_ActiveAssocID) { return; } AssocElement = document.getElementById('Assoc_'+AssocID); AnalyzeButtonElement = AssocElement.all['B_ANALYZE']; if(AnalyzeButtonElement.disabled == false) { AnalyzeButtonElement.focus(); } } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function FocusToSyncpath(AssocID, num) { if(AssocID != G_ActiveAssocID) { return; } AssocElement = document.getElementById('Assoc_'+AssocID); TreePathDiv = AssocElement.all["TreePath"+num]; if(TreePathDiv.disabled == false) { PlaceHintWindow(TreePathDiv, num); ExtGiveHint(AssocID, "Syncpath_hint_"+num); TreePathDiv.children(0).focus(); } } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function SwitchSyncDirectionArrow(AssocID, NewWinningSuperTreeID) { var AssocObj = external.ObjByID(AssocID); var Assoc_element = document.getElementById('Assoc_'+AssocID); var SyncBoardsTableBody_element = Assoc_element.all['SyncBoardsTable'].all[0]; var FoldersQuantity = G_Assocs[AssocID].FoldersQuantity; var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); if(SuperTreeList == null) { alert('SuperTreeList == null'); return 0; } var tbody_length = SyncBoardsTableBody_element.rows.length; var SyncTreeArray = new Array(); var SyncTreeList_length = 0; var Delete_buttons_html = ''; var If_one_way_sync = false; var SuperTree_Obj = SuperTreeList.GetFirst(); while(SuperTree_Obj != null) { SyncTreeArray[SyncTreeList_length] = {}; SyncTree_Obj = SuperTree_Obj.GetFirst(); if(SyncTree_Obj == null) { alert('SuperTree does not contain any SyncTree'); return 0; } if(NewWinningSuperTreeID == SuperTree_Obj.objID) { SyncTreeArray[SyncTreeList_length].cap_arrow_direction = '_out'; SyncTreeArray[SyncTreeList_length].radio = 'active'; If_one_way_sync = true; } else { SyncTreeArray[SyncTreeList_length].cap_arrow_direction = ''; SyncTreeArray[SyncTreeList_length].radio = 'unactive'; } // SyncTreeArray[SyncTreeList_length].obj = SyncTree_Obj; SyncTreeArray[SyncTreeList_length].superID = SuperTree_Obj.objID; SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); SyncTreeList_length++; } if(SyncTreeList_length != FoldersQuantity) { return; } Assoc_element.all['TopCapArrowLeft'].className = 'Cap_arrow_left'+SyncTreeArray[0].cap_arrow_direction; Assoc_element.all['TopCapArrowRight'].className = 'Cap_arrow_right'+SyncTreeArray[1].cap_arrow_direction; Assoc_element.all['TopCapRadioLeft'].children[0].src = 'Pics/Radio_left_'+SyncTreeArray[0].radio+'.gif'; Assoc_element.all['TopCapRadioRight'].children[0].src = 'Pics/Radio_right_'+SyncTreeArray[1].radio+'.gif'; for(i=2; i<FoldersQuantity; i++) { var row_element = SyncBoardsTableBody_element.rows[i-1]; var RightArrowCell = row_element.cells[3]; var RightRadioCell = row_element.cells[4]; RightArrowCell.children[0].className = 'Cap_arrow_right'+SyncTreeArray[i].cap_arrow_direction; RightRadioCell.children[0].src = 'Pics/Radio_right_'+SyncTreeArray[i].radio+'.gif'; } if(AssocID == G_ActiveAssocID) { if(NewWinningSuperTreeID == 'DIRECTION_ALL_WAY') { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way.gif'; } else { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way_unactive.gif'; } } } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function LoadAssocPaths(AssocID) { //------------------------------------------------------------------------------- var AssocObj = external.ObjByID(AssocID); var Assoc_element = document.getElementById('Assoc_'+AssocID); var SyncBoardsTableBody_element = Assoc_element.all['SyncBoardsTable'].all[0]; var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); //------------------------------------------------------------------------------- if(SuperTreeList == null) return 0; //------------------------------------------------------------------------------- var tbody_length = SyncBoardsTableBody_element.rows.length; for(i=tbody_length-1; i>0; i--) SyncBoardsTableBody_element.deleteRow(i); //------------------------------------------------------------------------------- var SyncTreeArray = new Array(); var SyncTreeList_length = 0; var SuperTree_Obj = SuperTreeList.GetFirst(); var Delete_buttons_html = ''; var If_one_way_sync = false; var SyncDirection = AssocObj.Method0('M_GetSyncDirection'); //------------------------------------------------------------------------------- if ((typeof(SyncDirection) == 'string') && (SyncDirection == external.AbbrToHex('DIRECTION_ALL_WAY'))) G_Assocs[AssocID].WinningSuperTreeID = CONST_CID; else G_Assocs[AssocID].WinningSuperTreeID = SyncDirection.objID; //------------------------------------------------------------------------------------------------------------------------------ var WinningSuperTreeID = G_Assocs[AssocID].WinningSuperTreeID; while(SuperTree_Obj != null) { SyncTreeArray[SyncTreeList_length] = {}; SyncTree_Obj = SuperTree_Obj.GetFirst(); if(SyncTree_Obj == null) { alert('SuperTree does not contain any SyncTree'); return 0; } if(WinningSuperTreeID == SuperTree_Obj.objID) { SyncTreeArray[SyncTreeList_length].cap_arrow_direction = '_out'; SyncTreeArray[SyncTreeList_length].radio = 'active'; If_one_way_sync = true; } else { SyncTreeArray[SyncTreeList_length].cap_arrow_direction = ''; SyncTreeArray[SyncTreeList_length].radio = 'unactive'; } SyncTreeArray[SyncTreeList_length].obj = SyncTree_Obj; SyncTreeArray[SyncTreeList_length].superID = SuperTree_Obj.objID; SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); SyncTreeList_length++; } //------------------------------------------------------------------------------- G_Assocs[AssocID].FoldersQuantity = SyncTreeArray.length; delete G_Assocs[AssocID].Folder_is_ready_array; G_Assocs[AssocID].Folder_is_ready_array = new Array(); Assoc_element.all['Cap_arrow_branch'].className = "Cap_arrow_branch0"; //------------------------------------------------------------------------------- for(i=0; i<2; i++) //First Sync board table row { var result = BuildFolderPanel(SyncBoardsTableBody_element.all['SyncTree'+i], SyncTreeArray[i].obj, i); G_Assocs[AssocID].Folder_is_ready_array[i] = result; SyncTreeArray[i].if_ready = result; } Assoc_element.all['TopCapArrowLeft'].className = 'Cap_arrow_left'+SyncTreeArray[0].cap_arrow_direction; Assoc_element.all['TopCapArrowRight'].className = 'Cap_arrow_right'+SyncTreeArray[1].cap_arrow_direction; Assoc_element.all['TopCapRadioLeft'].innerHTML = '<img tabindex="3" src="Pics/Radio_left_'+SyncTreeArray[0].radio+'.gif" class="Cap_Radio_control" onkeypress="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[0].superID+'\')" onclick="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[0].superID+'\')" title="'+external.LS('tooltip_one_way_sync')+'" onactivate="CapMenuFocusIn()" ondeactivate="CapMenuFocusOut()">'; Assoc_element.all['TopCapRadioRight'].innerHTML = '<img tabindex="3" src="Pics/Radio_right_'+SyncTreeArray[1].radio+'.gif" class="Cap_Radio_control" onkeypress="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[1].superID+'\')" onclick="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[1].superID+'\')" title="'+external.LS('tooltip_one_way_sync')+'" onactivate="CapMenuFocusIn()" ondeactivate="CapMenuFocusOut()">'; if(SyncTreeArray.length > 2) { Assoc_element.all['Cap_arrow_branch'].className = "Cap_arrow_branch1"; for(i=2; i<(SyncTreeArray.length-1); i++) { //All middle forders var NewRow = SyncBoardsTableBody_element.insertRow(); var EmptyFolderCell = NewRow.insertCell(); var EmptyCell = NewRow.insertCell(); EmptyCell.colSpan = '3'; EmptyCell.onclick=CapMenuClick; EmptyCell.onmouseleave=CapMenuLeave; EmptyCell.onmouseenter=CapMenuEnter; EmptyCell.className = 'CapMenuPlate'; var BranchCell = NewRow.insertCell(); BranchCell.innerHTML = '<div class="Cap_arrow_branch_middle"></div>'; BranchCell.onclick=CapMenuClick; BranchCell.onmouseleave=CapMenuLeave; BranchCell.onmouseenter=CapMenuEnter; BranchCell.className = 'CapMenuPlate'; var RightArrowCell = NewRow.insertCell(); RightArrowCell.height = '30'; RightArrowCell.innerHTML = '<div class="Cap_arrow_right'+SyncTreeArray[i].cap_arrow_direction+'"></div>'; RightArrowCell.onclick=CapMenuClick; RightArrowCell.onmouseleave=CapMenuLeave; RightArrowCell.onmouseenter=CapMenuEnter; RightArrowCell.className = 'CapMenuPlate'; var RadioCell = NewRow.insertCell(); RadioCell.innerHTML = '<img tabindex="3" src="Pics/Radio_right_'+SyncTreeArray[i].radio+'.gif" class="Cap_Radio_control" onkeypress="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[i].superID+'\')" onclick="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[i].superID+'\')" title="'+external.LS('tooltip_one_way_sync')+'" onactivate="CapMenuFocusIn()" ondeactivate="CapMenuFocusOut()">'; RadioCell.onclick=CapMenuClick; RadioCell.onmouseleave=CapMenuLeave; RadioCell.onmouseenter=CapMenuEnter; RadioCell.className = 'CapMenuPlate'; RadioCell.style.padding="5px"; var FolderCell = NewRow.insertCell(); FolderCell.bgcolor ="red"; //#C0C0B4 FolderCell.style.padding = "0px"; FolderCell.innerHTML = '<div style="position:relative; top:0; left:0;">'+ '<div id="Syncpath_hint_'+i+'" class="Right_hint_hidden"></div>'+ '</div>'+ '<div id="SyncTree'+i+'" synctree_id="" style="position:relative; width:100%; border:solid 1px #88BAC8;"></div>'; var result = BuildFolderPanel(SyncBoardsTableBody_element.all['SyncTree'+i], SyncTreeArray[i].obj, i); G_Assocs[AssocID].Folder_is_ready_array[i] = result; SyncTreeArray[i].if_ready = result; } i = SyncTreeArray.length-1; // --- Last folder var NewRow = SyncBoardsTableBody_element.insertRow(); var EmptyFolderCell = NewRow.insertCell(); var EmptyCell = NewRow.insertCell(); EmptyCell.colSpan = '3'; EmptyCell.onclick=CapMenuClick; EmptyCell.onmouseleave=CapMenuLeave; EmptyCell.onmouseenter=CapMenuEnter; EmptyCell.className = 'CapMenuPlate'; var BranchCell = NewRow.insertCell(); BranchCell.innerHTML = '<div class="Cap_arrow_branch_bottom"></div>'; BranchCell.onclick=CapMenuClick; BranchCell.onmouseleave=CapMenuLeave; BranchCell.onmouseenter=CapMenuEnter; BranchCell.className = 'CapMenuPlate'; var RightArrowCell = NewRow.insertCell(); RightArrowCell.height = '30'; RightArrowCell.innerHTML = '<div class="Cap_arrow_right'+SyncTreeArray[i].cap_arrow_direction+'"></div>'; RightArrowCell.onclick=CapMenuClick; RightArrowCell.onmouseleave=CapMenuLeave; RightArrowCell.onmouseenter=CapMenuEnter; RightArrowCell.className = 'CapMenuPlate'; var RadioCell = NewRow.insertCell(); RadioCell.innerHTML = '<img tabindex="3" src="Pics/Radio_right_'+SyncTreeArray[i].radio+'.gif" class="Cap_Radio_control" onkeypress="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[i].superID+'\')" onclick="CapRadioHandler(\''+AssocID+'\',\''+SyncTreeArray[i].superID+'\')" title="'+external.LS('tooltip_one_way_sync')+'" onactivate="CapMenuFocusIn()" ondeactivate="CapMenuFocusOut()">'; RadioCell.onclick=CapMenuClick; RadioCell.onmouseleave=CapMenuLeave; RadioCell.onmouseenter=CapMenuEnter; RadioCell.className = 'CapMenuPlate'; RadioCell.style.padding="5px"; var FolderCell = NewRow.insertCell(); FolderCell.bgcolor ="#C0C0B4"; FolderCell.style.padding = "0px"; FolderCell.innerHTML = '<div style="position:relative; top:0; left:0;">'+ '<div id="Syncpath_hint_'+i+'" class="Right_hint_hidden"></div>'+ '</div>'+ '<div id="SyncTree'+i+'" synctree_id="" style="position:relative; width:100%; border:solid 1px #88BAC8;"></div>'; var result = BuildFolderPanel(SyncBoardsTableBody_element.all['SyncTree'+i], SyncTreeArray[i].obj, i); G_Assocs[AssocID].Folder_is_ready_array[i] = result; SyncTreeArray[i].if_ready = result; // ------------------ } if(AssocID == G_ActiveAssocID) { if(WinningSuperTreeID == CONST_CID) { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way.gif'; } else { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way_unactive.gif'; } If_remove_check.checked = AssocObj.Method0('M_GetMimicDeleted'); If_rewrite_check.checked = AssocObj.Method0('M_GetMimicChanged'); // fixing of bug with vertical lilnes // will be ResizeWindow(); } // before fixing of bug with vertical lines // ResizeWindow(); var HintCalledNumber = -1; for(i=SyncTreeArray.length-1; i>=0; i--) { if(SyncTreeArray[i].if_ready == false) { HintCalledNumber = i; } } if(HintCalledNumber != -1) { G_Assocs[AssocID].Folders_is_ready = false; setTimeout("FocusToSyncpath('"+AssocID+"', '"+HintCalledNumber+"')", 0); return 0; } G_Assocs[AssocID].Folders_is_ready = true; return true; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function BuildFolderPanel(SyncTreeElement, SyncTreeObject, FolderNum) // Returns true if tree is ready and false otherwise { SyncTreeElement.synctree_id=SyncTreeObject.objID; if(SyncTreeObject.Method0('M_IsTreeReady') == 1) { SyncTree_path = SyncTreeObject.Method0Own('M_ToViewFilename'); if_empty_flag = "false"; IfTreeReady = true; } else { SyncTree_path =""; if_empty_flag = "true"; IfTreeReady = false; } SyncTreeElement.innerHTML = '<form id="TreeForm'+FolderNum+'" onSubmit="return ChangeSyncTree('+FolderNum+');" style="margin:0px;" title="'+ external.LS("tooltip_sync_board_right")+ '" ondeactivate="Deactivate_form('+FolderNum+',\''+G_ActiveAssocID+'\')" is_changed="false" is_empty="'+if_empty_flag+'">'+ '<table width="100%" cellspacing="0">'+ '<tr>'+ '<td colspan="3" width="100%" height="22px;">'+ '<div style="position:relative; top:0px; left:0px; height:22px;">'+ '<div id="TreePath'+FolderNum+'" style="position:absolute; top:0px; left:0px; width:100%; height:25px;">'+ '<input tabindex="2" id="'+SyncTreeObject.objID+'_path" type="text" value="'+SyncTree_path+ '" style="width:100%; border: solid 1px black; background:#f6f6f6; font-family:tahoma; font-size:10pt;" onkeyup="Ok_Activate('+ FolderNum+')" onactivate="Activate_form('+FolderNum+')">'+ '</div>'+ '</div>'+ '</td>'+ '</tr>'+ '<tr>'+ '<td nowrap>'+ '<span title="'+ external.LS("tooltip_FSP_Open") + '" tabindex="2" name="TreeOpen'+FolderNum+'" id="TreeOpen'+FolderNum+'" onclick="OpenSyncTree(' + FolderNum+')" onmouseenter=FolderButtonSelect(this) onmouseleave=FolderButtonUnselect(this) style="width:67px; height: 20px; ' + 'font-size:11px; font-family:Arial; padding-top:3px; text-align: center; color:black; background:url(Pics/Folder_button.gif) background-position:top left;">' + external.LS("button_open")+'</span>'+ '<span title="'+ external.LS("tooltip_FSP_Browse") + '" tabindex="2" name="TreeBrowse'+FolderNum+'" id="TreeBrowse'+FolderNum+'" onclick=BrowseSyncTree(' + FolderNum+') onmouseenter=FolderButtonSelect(this) onmouseleave=FolderButtonUnselect(this) style="width:67px; height: 20px; ' + 'font-size:11px; font-family:Arial; padding-top:3px; text-align: center; color:black; background:url(Pics/Folder_button.gif) background-position:top left;">' + external.LS("button_browse")+'</span>'+ '</td>'+ '<td width="100%">'+ '</td>'+ '<td id="TreeSubmitButtons'+FolderNum+'" nowrap>'+ '<span title="'+ external.LS("tooltip_FSP_Ok") + '" tabindex="2" type="submit" name="TreeOk'+FolderNum + '" disabled id="TreeOk'+FolderNum + '" onclick="return ChangeSyncTree('+FolderNum+');"' + 'onmouseenter=FolderButtonSelect(this) onmouseleave=FolderButtonUnselect(this) style="width:67px; height: 20px; ' + 'font-size:11px; font-family:Arial; padding-top:3px; text-align: center; color:black; background:url(Pics/Folder_button_off.gif) background-position:top left;">' + external.LS("button_ok")+'</span>'+ '<span title="'+ external.LS("tooltip_FSP_Cancel") + '" tabindex="2" name="TreeCancel'+FolderNum + '" disabled id="TreeCancel'+FolderNum + '" onclick="CancelSyncTree('+FolderNum+');"'+ 'onmouseenter=FolderButtonSelect(this) onmouseleave=FolderButtonUnselect(this) style="width:67px; height: 20px; ' + 'font-size:11px; font-family:Arial; text-color: black; padding-top:3px; text-align: center; color:black; background:url(Pics/Folder_button_off.gif) background-position:top left;">' + external.LS("button_cancel")+'</span>'+ '</td>'+ '</tr>'+ '</table>'+ '</form>'; return IfTreeReady; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function OnCollectionExpandIconClick(AssocID, CollectionID) { G_Assocs[AssocID].TreeView.click(CollectionID); } //----------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------- function go_next_message(CollectionID) { G_Collection_lock = true; //----------------------- var collection_container = document.all[CollectionID+'_container']; if(collection_container == null) { G_Collection_lock = false; return;} //----------------------------------------------------------------------------------------- var msgs = external.ObjByID(CollectionID); var msgs_count = collection_container.children.length; MsgID = collection_container.children(msgs_count - 1).id; var new_on_page_last_msg = msgs.GetNext(msgs.ObjByID(MsgID)) if (new_on_page_last_msg == null) { G_Collection_lock = false; return;} var new_on_page_last_msg_id = msgs.GetNext(msgs.ObjByID(MsgID)).objID; //---------------------------------------------------------- var MsgID = collection_container.children(0).id; var message_container_element = collection_container.all[MsgID]; if (message_container_element) message_container_element.removeNode(true); //----------------------------------------------------------------------------------------- var current_first_message_element_index = msgs.Method0('M_GetFirstVisibleMessageIndex'); msgs.method1('M_SetFirstVisibleMessageByIndex', current_first_message_element_index + 1); var MsgEvenness = G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness; G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = 1 - MsgEvenness; var new_last_message_element = document.createElement('tbody'); collection_container.appendChild(new_last_message_element); BuildMessageAsObject(new_last_message_element, CollectionID, new_on_page_last_msg_id, (MsgEvenness+CONST_MESSAGES_ON_PAGE)%2); //----------------------- G_Collection_lock = false; //----------------------- AutoRefreshScrollers(G_ActiveAssocID, CollectionID); } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function go_prev_message(CollectionID) { G_Collection_lock = true; //----------------------- var collection_container = document.all[CollectionID+'_container']; if(collection_container == null) { G_Collection_lock = false; return;} //----------------------------------------------------------------------------- var msgs = external.ObjByID(CollectionID); var first_visible_msg_id = msgs.Method0('M_GetFirstVisibleMessage').objID; var first_msg_id = msgs.GetFirst().objID; if (first_visible_msg_id == first_msg_id) { G_Collection_lock = false; return;} //----------------------------------------------------------------------------- var msgs_count = collection_container.children.length; var MsgID = collection_container.children(msgs_count - 1).id; var message_container_element = collection_container.all[MsgID]; if (message_container_element) message_container_element.removeNode(true); //----------------------------------------------------------------------------------------- var new_first_msg_index = msgs.Method0('M_GetFirstVisibleMessageIndex') - 1; msgs.method1('M_SetFirstVisibleMessageByIndex', new_first_msg_index); //----------------------------------------------------------------------------------------- var new_first_msg_id = msgs.Method0('M_GetFirstVisibleMessage').objID; //----------------------------------------------------------------------------------------- var new_first_msg_evenness = (G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness+1)%2; G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = new_first_msg_evenness; //----------------------------------------------------------------------------------------- var new_first_msg_element = document.createElement('tbody'); collection_container.insertBefore(new_first_msg_element, collection_container.children(0)); BuildMessageAsObject(new_first_msg_element, CollectionID, new_first_msg_id, new_first_msg_evenness); //----------------------------------------------------------------------------------------- G_Collection_lock = false; //----------------------- AutoRefreshScrollers(G_ActiveAssocID, CollectionID); } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function go_first_page(CollectionID) { G_Collection_lock = true; //----------------------- var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; msgs.Method1('M_SetFirstVisibleMessageByIndex', 0); G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = 1; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); //----------------------- G_Collection_lock = false; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function go_last_page(CollectionID) { G_Collection_lock = true; //----------------------- var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; var msg_count = msgs.Method0('M_GetCount'); var page_size = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); var msg_index = msg_count - page_size; //alert(msg_index);// (R) if (msg_index < 0) msg_index = 0; //----------------------------------------- msgs.Method1('M_SetFirstVisibleMessageByIndex', msg_index); //alert(msgs.Method0('M_GetFirstVisibleMessage'))); G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = 1; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); //------------------------ G_Collection_lock = false; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function go_prev_page(CollectionID) { G_Collection_lock = true; //----------------------- var control_element = window.event.srcElement; var AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); var collection_container = AssocElement.all[CollectionID+'_container']; if(collection_container == null) return; //---------------------------------------------------------------------------------------- var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; //---------------------------------------------------------------------------------------- var msg = msgs.Method0('M_GetFirstVisibleMessage'); var msg_index = msgs.Method0('M_GetFirstVisibleMessageIndex'); var page_size = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); if (msg_index < page_size) msg_index = 0; else msg_index = msg_index - page_size; //---------------------------------------------------------------------------- msgs.Method1('M_SetFirstVisibleMessageByIndex', msg_index); var MsgEvenness = G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness; G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = (MsgEvenness+page_size)%2; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); //----------------------- G_Collection_lock = false; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function go_next_page(CollectionID) { G_Collection_lock = true; //----------------------- var control_element = window.event.srcElement; var AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); var collection_container = AssocElement.all[CollectionID+'_container']; if(collection_container == null) return; //---------------------------------------------------------------------------------------- var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; //---------------------------------------------------------------------------------------- var msg = msgs.Method0('M_GetFirstVisibleMessage'); var msg_index = msgs.Method0('M_GetFirstVisibleMessageIndex'); if (msg != null) var lastVisibleMsg = msg; while (msg != null) { msg = msgs.Method1('M_GetNextVisibleMessage', msg); if (msg != null) { lastVisibleMsg = msg; msg_index++;} } //---------------------------------------------------------------------------------------- var firstVisibleMsg = msgs.GetNext(lastVisibleMsg); if (firstVisibleMsg != null) { msg_index++; msg_count = msgs.Method0('M_GetCount'); page_size = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); if (msg_index + page_size >= msg_count) msg_index = msg_count - page_size; //---------------------------------------------------------------------------- msgs.Method1('M_SetFirstVisibleMessageByIndex', msg_index); MsgEvenness = G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness; G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]._first_disp_msg_evenness = (MsgEvenness+page_size)%2; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); } //----------------------- G_Collection_lock = false; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function CreateScrollControls(direction, if_active, CollectionID, MsgScrollersExist) { if(!MsgScrollersExist) { this.msg = '<img src="Pics/Dot.gif">'; this.page = '<img src="Pics/Dot.gif">'; this.end = '<img src="Pics/Dot.gif">'; this.top_msg = '<img src="Pics/Dot.gif">'; this.top_page = '<img src="Pics/Dot.gif">'; this.top_end = '<img src="Pics/Dot.gif">'; this.scroll = '<img src="Pics/Dot.gif">'; return this; } if(direction == 'next') { dir1 = 'next'; dir2 = 'Next'; dir3 = 'last'; dir4 = 'Last'; var v_border = 'border-right:solid 1px #787864;'; } else { dir1 = 'prev'; dir2 = 'Prev'; dir3 = 'first'; dir4 = 'First'; var v_border = 'border-left:solid 1px #787864;'; } var border_style = 'style="margin-left: 1px;"';//'style="border-top:solid 1px #787864; border-bottom:solid 1px #787864;"'; var border_style_brink = 'style="margin-left: 1px;"'; //'style="border-top:solid 1px #787864; border-bottom:solid 1px #787864; '+v_border+'"'; if(if_active == true) { this.msg = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir1+'_message(\''+CollectionID+'\');" ondblclick="go_'+dir1+'_message(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" onmouseup="ScrollControlUp(this)" src="Pics/'+dir2+'Message.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir1+"_message")+'">'; this.page = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir1+'_page(\''+CollectionID+'\');" ondblclick="go_'+dir1+'_page(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" src="Pics/'+dir2+'Page.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir1+"_page")+'">'; this.end = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir3+'_page(\''+CollectionID+'\');" ondblclick="go_'+dir3+'_page(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" src="Pics/To'+dir4+'.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir3+"_page")+'">'; this.top_msg = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir1+'_message(\''+CollectionID+'\');" ondblclick="go_'+dir1+'_message(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" onmouseup="ScrollControlUp(this)" src="Pics/'+dir2+'Message.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir1+"_message")+'" '+border_style+'>'; this.top_page = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir1+'_page(\''+CollectionID+'\');" ondblclick="go_'+dir1+'_page(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" src="Pics/'+dir2+'Page.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir1+"_page")+'" '+border_style+'>'; this.top_end = '<img onmousedown="ScrollControlDown(this)" onclick="go_'+dir3+'_page(\''+CollectionID+'\');" ondblclick="go_'+dir3+'_page(\''+CollectionID+'\');" onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)" src="Pics/To'+dir4+'.gif" style="cursor:hand" title="'+external.LS("tooltip_"+dir3+"_page")+'" '+border_style_brink+'>'; } else { this.msg = '<img src="Pics/'+dir2+'Message_gray.gif" >'; this.page = '<img src="Pics/'+dir2+'Page_gray.gif" >'; this.end = '<img src="Pics/To'+dir4+'_gray.gif">'; this.top_msg = '<img src="Pics/'+dir2+'Message_gray.gif" '+border_style+'>'; this.top_page = '<img src="Pics/'+dir2+'Page_gray.gif" '+border_style+'>'; this.top_end = '<img src="Pics/To'+dir4+'_gray.gif" '+border_style_brink+'>'; } //---------------------------------------------------------------------------------------------------------------------------------------------------- // scrolling block begin //---------------------------------------------------------------------------------------------------------------------------------------------------- { var collection_message_list = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; var message_counter_value = collection_message_list.Method0('M_GetCount'); //alert(message_counter_value); //---------------------------------------------------------------------------------------------------- if (msgIndex == null) var top_message_index = collection_message_list.method0('M_GetFirstVisibleMessageIndex'); else var top_message_index = msgIndex; //alert(collection_message_list.method0('M_GetFirstVisibleMessageIndex') +' '+ msgIndex); //---------------------------------------------------------------------------------------------------- var bar_container_height = Math.round(100*(CONST_MESSAGES_ON_PAGE/10) + (CONST_MESSAGES_ON_PAGE/10 - 1) * 90) - 7; if ((message_counter_value <= CONST_MESSAGES_ON_PAGE)) var factor = 0; else var factor = (top_message_index)/(message_counter_value - CONST_MESSAGES_ON_PAGE); //alert((top_message_index) + '/(' + message_counter_value + '-' + CONST_MESSAGES_ON_PAGE + ')'); var scroll_bar_y = factor*(bar_container_height - 15); scroll_bar_y = Math.round(scroll_bar_y); //---------------------------------- this.scroll = '<div style="position: relative; height:' + bar_container_height + ';">' + '<div id="'+CollectionID+'BarWrapContainer" ' + ' collectionID="'+CollectionID+'" ' + 'style="position: absolute; z-index:0; width:16px; height:' + bar_container_height + '; top:0; left:0; '+ 'background:url(\'Pics/ScrBar_ground.gif\'); background-repeat:repeat-y; background-position:top left;">' + '<div id="'+CollectionID+'BarWrap" class="draggable" collectionID="' + CollectionID + '"' + 'style="position: absolute; left:0; top:' + scroll_bar_y + '; width: 16px; height:15px; border: solid black 0px; z-index:0;">' + '<img id="'+CollectionID+'Bar" name="' + CollectionID + 'Bar" ' + ' src="Pics/ScrBar.gif" width="16px" height="15px" border="0" style="cursor: hand;" '+ ' onmouseenter="ScrollControlHi(this)" onmouseleave="ScrollControlUsual(this)">' + '</div>' + '</div>' + '</div>'; } //---------------------------------------------------------------------------------------------------------------------------------------------------- // scrolling block end //---------------------------------------------------------------------------------------------------------------------------------------------------- return this; } // -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- function RefreshMsgScrollers(AssocElement, direction, if_active, CollectionID, MsgScrollersExist) { var collection_scrollbar = AssocElement.all[CollectionID+'_ScrollBar']; if (collection_scrollbar == null) return; var collection_top_scrollbar = AssocElement.all[CollectionID+'_in']; var Scroll_controls = new CreateScrollControls(direction, if_active, CollectionID, MsgScrollersExist); if(direction == 'next') { dir2 = 'Next'; } else { dir2 = 'Prev'; } collection_scrollbar.all[dir2+'_msg'].innerHTML = Scroll_controls.msg; collection_scrollbar.all[dir2+'_page'].innerHTML = Scroll_controls.page; collection_scrollbar.all[dir2+'_end'].innerHTML = Scroll_controls.end; collection_scrollbar.all['Scroll_all'].innerHTML = Scroll_controls.scroll; collection_top_scrollbar.all['Top'+dir2+'_msg'].innerHTML = Scroll_controls.top_msg; collection_top_scrollbar.all['Top'+dir2+'_page'].innerHTML = Scroll_controls.top_page; collection_top_scrollbar.all['Top'+dir2+'_end'].innerHTML = Scroll_controls.top_end; } //------------------------------------------------------------------------------------------------- function ScrollControlHi(control_element) { var control_src = control_element.src; if(control_src == null) return; control_element.src = control_src.replace(/.gif/,"_hi.gif"); } function ScrollControlUsual(control_element) { var control_src = control_element.src; if(control_src == null) return; control_element.src = control_src.replace(/(_hi)?.gif/,".gif"); } function ScrollControlUp(control_element) { var control_src = control_element.src; if(control_src == null) return; control_element.src = control_src.replace(/(_hi)?.gif/,"_hi.gif"); } function ScrollControlDown(control_element) { if(control_element == null ) return; if(control_element.tagName != 'IMG') return; var control_src = control_element.src; // Error 1152 occurred at 1-5-2 if(control_src == null ) return; control_element.src = control_src.replace(/(_hi)?.gif/,".gif"); } //------------------------------------------------------------------------------------------------- function ExtCountersRefresh(CollectionID, Counter) { CounterRefresh(G_ActiveAssocID, CollectionID, Counter); if (G_Collection_lock == false) {AutoRefreshScrollers(G_ActiveAssocID, CollectionID);} } //------------------------------------------------------------------------------------------------- function CounterRefresh(AssocID, CollectionID, Counter) { var collection = G_Assocs[AssocID].TreeView._collections[CollectionID]; if (collection) { var collection_message_list = G_Assocs[AssocID].TreeView._collections[CollectionID].obj;} else { var collection_message_list = null;} if(collection_message_list != null) { var collection_node = G_Assocs[AssocID].TreeView.root._children[CollectionID]; //----------------------------------------------------------------------------------------------------- // if it is required collection initialization in GUI //----------------------------------------------------------------------------------------------------- if((collection_node._empty == true) && (collection_node._expanded == false)) { collection_node._empty = false; collection_node._first_disp_msg_evenness = 1; G_Assocs[AssocID].TreeView.redraw_collection(CollectionID); } if (Counter == 0) G_Assocs[AssocID].TreeView.redraw_collection(CollectionID); //----------------------------------------------------------------------------------------------------- // counter refreshing //----------------------------------------------------------------------------------------------------- var association_element = document.getElementById('Assoc_'+AssocID); var collection_caption_element = association_element.all[CollectionID+'_caption']; if (collection_caption_element) collection_caption_element.innerHTML = Counter; } } //------------------------------------------------------------------------------------------------- function FillMsgNode(MsgObj, MsgEvenness, CollectionID) { var msg_html = ''; if(MsgEvenness == 0) { var TbodyClass = "Msg_Even"; } else { var TbodyClass = "Msg_Odd"; } if(MsgObj.IsSyncItemMsg()) { //------------------------------------------------------ solution = MsgObj.GetObjM('m_SolutionWPtr'); if(solution == null) { alert("solution == null"); return ''; } //------------------------------------------------------ var WinningTreeID = solution.Method0('M_GetWinningActionAsID'); //DU solution.GetM('MM_WinningTreeID'); if(WinningTreeID == CONST_WIN_NO_SYNC) { Radio_dont_sync = 'true'; Radio_del_sync = 'false'; } else if(WinningTreeID == CONST_WIN_DEL_SYNC)//DELL_ALL { Radio_dont_sync = 'false'; Radio_del_sync = 'true'; } else { Radio_dont_sync = 'false'; Radio_del_sync = 'false'; } //------------------------------------------------------ var AssocObj = MsgObj.GetM('m_SlnDoAssocSyncWPtr'); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SolutionActionState = solution.Method0('M_GetActionState');//DU solution.GetM('MM_ActionState'); if(SolutionActionState == CONST_ACTION_STATE_INIT) //ACTION_STATE_INIT { var Menu_handler = 'onmouseenter="ShowFM()" onmouseleave="HideFM()" onclick=OnPopupClick() oncontextmenu="StopContextMenu()" msg_id="'+MsgObj.objID+'" collection_id="'+CollectionID+'"'; var If_gray = ''; var Progress = ''; if (solution.Method0('M_GetAvailableItemForSynchronization') == false) { Menu_handler = ''; If_gray = '_gray'; var Progress = ''; } } else if(SolutionActionState == CONST_ACTION_STATE_IN_PROGRESS) //ACTION_STATE_IN_PROGRESS { var Menu_handler = ''; var If_gray = ''; var Progress = '_progressed'; } else if(SolutionActionState == CONST_ACTION_STATE_DONE) //ACTION_STATE_DONE { var Menu_handler = ''; var If_gray = '_gray'; var Progress = ''; } else { alert('FillMsgNode3: SolutionActionState == '+SolutionActionState+' is out of range'); } //------------------------------------------------------------------- SyncTreeArray = new Array(); var i = 0; var Missing_active = false; var SuperTree_Obj = SuperTreeList.GetFirst(); while(SuperTree_Obj != null) { SyncTreeArray[i] = {}; SyncTree_Obj = SuperTree_Obj.GetFirst(); SyncTreeArray[i].obj = SyncTree_Obj; SyncTreeArray[i].id = SuperTree_Obj.objID; //DU SyncTree_Obj.GetM('MM_TreeID'); SyncTreeArray[i].file_name = solution.Method1('M_CreateFullPathStrBySuperTree', SuperTree_Obj); //DU Method1ID('M_CreateFullPathStrByTreeID', SyncTreeArray[i].id); SyncTreeArray[i].SyncItemCharacteristics = new CreateSyncItemCharacteristics(solution, SuperTree_Obj, CollectionID); //-------------------------------------------------------------------------------- if((WinningTreeID != CONST_WIN_NO_SYNC) && ((WinningTreeID != CONST_WIN_DEL_SYNC))) { if(SyncTreeArray[i].id == WinningTreeID) { SyncTreeArray[i].arrow_direction = 'out'+If_gray+Progress; SyncTreeArray[i].radio = 'active'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; if(SyncTreeArray[i].SyncItemCharacteristics.if_missing == true) { Missing_active = true; } } else // item is not a winner { if(SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler =''; } else { SyncTreeArray[i].arrow_direction = 'in'+If_gray+Progress; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; } } } else if (WinningTreeID == CONST_WIN_NO_SYNC) { SyncTreeArray[i].arrow_direction = 'no'+If_gray+Progress; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; if(SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].radio_handler =''; SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } } else if (WinningTreeID == CONST_WIN_DEL_SYNC) { SyncTreeArray[i].arrow_direction = 'no'+If_gray+Progress; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; if(SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].radio_handler =''; SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } } SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); i++; } //--------------------------------------------------------------------------- var SyncTreeList_length = i; if(Missing_active == true) { for(i=0; i<SyncTreeList_length; i++) { if(SyncTreeArray[i].arrow_direction == 'in'+If_gray+Progress) { SyncTreeArray[i].arrow_direction = 'del'+If_gray+Progress; } } } //--------------------------------------------------------------------------- if(WinningTreeID == CONST_WIN_DEL_SYNC) { for(i=0; i<SyncTreeList_length; i++) { if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } else SyncTreeArray[i].arrow_direction = 'del'+If_gray+Progress; } } //--------------------------------------------------------------------------- // New! if(WinningTreeID == CONST_WIN_NO_SYNC) { for(i=0; i<SyncTreeList_length; i++) { if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } else SyncTreeArray[i].arrow_direction = 'no'+If_gray+Progress; } } //--------------------------------------------------------------------------- var Gray0 = ''; var Gray1 = ''; if (SyncTreeArray[0].SyncItemCharacteristics.if_available == false) Gray0 = '_gray'; if (SyncTreeArray[1].SyncItemCharacteristics.if_available == false) Gray1 = '_gray'; if (SyncTreeList_length == 2) { msg_html = '<tbody id="'+MsgObj.objID+'" class="'+TbodyClass+'" if_dont_sync="'+Radio_dont_sync+ '" if_del_sync="'+Radio_del_sync+'" msg_type="2" exist="true" oncontextmenu="OnMsgContextMenu()">'+ '<tr class="Single_row">'+ //------------------------------------------------------------------------- CreateSyncItemCharacteristicsHTML(SyncTreeArray[0].SyncItemCharacteristics)+ //------------------------------------------------------------------------- '<td class="Left_cell" '+Menu_handler+'>'+ '<img src="Pics/Radio_left_'+SyncTreeArray[0].radio+Gray0+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+SyncTreeArray[0].radio_handler+'></td>'+ //------------------------------------------------------------------------- '<td height="100%" '+Menu_handler+'>'+ '<div id="Base_'+MsgObj.objID+'" class="Back_plate"><div class="Arrow_left_'+SyncTreeArray[0].arrow_direction+'"></div></div></td>'+ //------------------------------------------------------------------------- '<td height="100%" '+Menu_handler+'>'+ '<div class="Back_plate"><div class="Arrow_mid_single'+If_gray+'"></div></div></td>'+ //------------------------------------------------------------------------- '<td height="100%" '+Menu_handler+'>'+ '<div class="Back_plate"><div class="Arrow_right_'+SyncTreeArray[1].arrow_direction+'"></div></div></td>'+ //------------------------------------------------------------------------- '<td class="Right_cell" '+Menu_handler+'>'+ '<img src="Pics/Radio_right_'+SyncTreeArray[1].radio+Gray1+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+SyncTreeArray[1].radio_handler+'></td>'+ //------------------------------------------------------------------------- CreateSyncItemCharacteristicsHTML(SyncTreeArray[1].SyncItemCharacteristics)+ //------------------------------------------------------------------------- '</tr>'+ '</tbody>'; } if (SyncTreeList_length > 2) { msg_html = '<tbody id="'+MsgObj.objID+'" class="'+TbodyClass+'" if_dont_sync="'+Radio_dont_sync+ '" if_del_sync="'+Radio_del_sync+'" msg_type="3" exist="true" oncontextmenu="OnMsgContextMenu()">'; //First row msg_html += '<tr class="First_row">'+CreateSyncItemCharacteristicsHTML(SyncTreeArray[0].SyncItemCharacteristics)+ '<td class="Left_cell" '+Menu_handler+'>'+ '<img src="Pics/Radio_left_'+SyncTreeArray[0].radio+Gray0+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+SyncTreeArray[0].radio_handler+'></td>'+ '<td height="100%" '+Menu_handler+'>'+ '<div class="Back_plate"><div class="Arrow_left_'+SyncTreeArray[0].arrow_direction+'"></div></div></td>'+ '<td height="100%" '+Menu_handler+'>'+ '<div id="Base_up_'+MsgObj.objID+'" class="Back_plate"><div class="Arrow_mid_top'+If_gray+'"></div></div></td>'+ '<td '+Menu_handler+'><div class="Back_plate">'+ '<div class="Arrow_right_'+SyncTreeArray[1].arrow_direction+'"></div></div></td>'+ '<td class="Right_cell" '+Menu_handler+'>'+ '<img src="Pics/Radio_right_'+SyncTreeArray[1].radio+Gray1+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+SyncTreeArray[1].radio_handler+'></td>'+ CreateSyncItemCharacteristicsHTML(SyncTreeArray[1].SyncItemCharacteristics)+'</tr>'; //Middle rows for(i=2; i<SyncTreeList_length-1; i++) { var Gray = ''; if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) Gray = '_gray'; msg_html += '<tr class="Mid_row">'+ CreateSyncItemCharacteristicsHTML(null)+ '<td class="Left_cell" '+Menu_handler+'>'+'</td>'+ '<td height="100%" '+Menu_handler+'>'+'<div class="Back_plate"></div></td>'+ '<td height="100%" '+Menu_handler+'>'+'<div class="Back_plate"><div class="Arrow_mid_mid'+If_gray+'"></div></div></td>'+ '<td '+Menu_handler+'><div class="Back_plate">'+ '<div class="Arrow_right_'+SyncTreeArray[i].arrow_direction+'"></div></div></td>'+ '<td class="Right_cell" '+Menu_handler+'>'+ '<img src="Pics/Radio_right_'+SyncTreeArray[i].radio+Gray+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+SyncTreeArray[i].radio_handler+'></td>'+ CreateSyncItemCharacteristicsHTML(SyncTreeArray[i].SyncItemCharacteristics)+'</tr>'; } //Last row var Gray = ''; if (SyncTreeArray[SyncTreeList_length-1].SyncItemCharacteristics.if_available == false) Gray = '_gray'; msg_html += '<tr class="Last_row">'+CreateSyncItemCharacteristicsHTML(null)+ '<td class="Left_cell" '+Menu_handler+'>'+'</td>'+ '<td height="100%" '+Menu_handler+'>'+'<div class="Back_plate"></div></td>'+ '<td height="100%" '+Menu_handler+'>'+'<div id="Base_down_'+MsgObj.objID+ '" class="Back_plate"><div class="Arrow_mid_bottom'+If_gray+'"></div></div></td>'+ '<td '+Menu_handler+'><div class="Back_plate">'+ '<div class="Arrow_right_'+SyncTreeArray[SyncTreeList_length-1].arrow_direction+'"></div></div></td>'+ '<td class="Right_cell" '+Menu_handler+'>'+ '<img id="radio_left" src="Pics/Radio_right_'+SyncTreeArray[SyncTreeList_length-1].radio+Gray+'.gif" '+ 'title="'+external.LS('hint_Winner')+'" '+ 'class="Radio_control" '+ SyncTreeArray[SyncTreeList_length-1].radio_handler+'></td>'+ CreateSyncItemCharacteristicsHTML(SyncTreeArray[SyncTreeList_length-1].SyncItemCharacteristics)+'</tr>'; msg_html += '</tbody>'; } return msg_html; } else // Message is not sync item { var itemId_in_sync_item_collection = MsgObj.Method0('M_GetLinkID'); var link_to_sync_item = ''; if(CONST_CID != itemId_in_sync_item_collection) { link_to_sync_item = ''; //'<span style="cursor:hand; color:blue; margin-left:15px; text-decoration: underline;" '+ //'onmouseover="OnMouseOverPath()" onmouseout="OnMouseOutPath()" '+ //'onclick=LinkToCollectionMsg("All","'+itemId_in_sync_item_collection+'")>'+ //external.LS('tooltip_goto_sync_item')+'</span>'; } msg_html = '<tbody id="'+MsgObj.objID+'" class="'+TbodyClass+'" exist="true" oncontextmenu="OnMsgContextMenu()"><tr class="Single_row">'+ '<td colspan="11" class="info_msg">'+ '<span id="Link'+CollectionID+MsgObj.objID+'"></span>'+ MsgObj.ToString()+ CreateMsgButtons(MsgObj)+ link_to_sync_item+ '</td></tr></tbody>'; return msg_html; } } function BuildMessageAsObject(message_tbody_element, CollectionID, MessageID, MsgEvenness) { if(MsgEvenness == 0) TbodyClass = "Msg_Even"; else TbodyClass = "Msg_Odd"; var MsgObj = external.ObjByID(MessageID); var AssocObj = MsgObj.GetM('m_SlnDoAssocSyncWPtr'); var AssocID = AssocObj.objID; message_tbody_element.id = MessageID; message_tbody_element.className = TbodyClass; message_tbody_element.oncontextmenu = OnMsgContextMenu; //-------------------------------------------------------------------- var tbody_length = message_tbody_element.rows.length; for(i=0; i<tbody_length; i++) message_tbody_element.deleteRow(); //-------------------------------------------------------------------- if(MsgObj.IsSyncItemMsg()) { solution = MsgObj.GetObjM('m_SolutionWPtr'); if(solution == null) { alert("solution == null"); return ""; } //------------------------------------------------------------- var WinningTreeID = solution.Method0('M_GetWinningActionAsID'); //DU solution.GetM('MM_WinningTreeID'); if(WinningTreeID == CONST_WIN_NO_SYNC) { Radio_dont_sync = 'true'; Radio_del_sync = 'false'; } else if (WinningTreeID == CONST_WIN_DEL_SYNC) { Radio_dont_sync = 'false'; Radio_del_sync = 'true'; } else { Radio_dont_sync = 'false'; Radio_del_sync = 'false'; } //------------------------------------------------------------- var AssocObj = MsgObj.GetM('m_SlnDoAssocSyncWPtr'); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SolutionActionState = solution.Method0('M_GetActionState');//DU solution.GetM('MM_ActionState'); if(SolutionActionState == CONST_ACTION_STATE_INIT) //ACTION_STATE_INIT { var Menu_handlers_on = true; var If_gray = ''; var Progress = ''; } else if(SolutionActionState == CONST_ACTION_STATE_IN_PROGRESS) //ACTION_STATE_IN_PROGRESS { var Menu_handlers_on = false; var If_gray = ''; var Progress = '_progressed'; } else if(SolutionActionState == CONST_ACTION_STATE_DONE) //ACTION_STATE_DONE { var Menu_handlers_on = false; var If_gray = '_gray'; var Progress = ''; } else { alert('BuildMessageAsObject3: SolutionActionState == '+SolutionActionState+' is out of range'); } //------------------------------------------------------------- SyncTreeArray = new Array(); var i = 0; var Missing_active = false; SuperTree_Obj = SuperTreeList.GetFirst(); while(SuperTree_Obj != null) { SyncTreeArray[i] = {}; SyncTree_Obj = SuperTree_Obj.GetFirst(); SyncTreeArray[i].obj = SyncTree_Obj; SyncTreeArray[i].id = SuperTree_Obj.objID; //DU SyncTree_Obj.GetM('MM_TreeID'); SyncTreeArray[i].file_name = solution.Method1('M_CreateFullPathStrBySuperTree', SuperTree_Obj); //DU Method1ID('M_CreateFullPathStrByTreeID', SyncTreeArray[i].id); SyncTreeArray[i].SyncItemCharacteristics = new CreateSyncItemCharacteristics(solution, SuperTree_Obj, CollectionID); if((WinningTreeID != CONST_WIN_NO_SYNC) && (WinningTreeID != CONST_WIN_DEL_SYNC)) { if(SyncTreeArray[i].id == WinningTreeID) { SyncTreeArray[i].arrow_direction = 'out'+If_gray+Progress; SyncTreeArray[i].radio = 'active'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; if(SyncTreeArray[i].SyncItemCharacteristics.if_missing == true) { Missing_active = true; } } else // if item is not winner { if(SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler =''; } else { SyncTreeArray[i].arrow_direction = 'in'+If_gray+Progress; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; } } } else { SyncTreeArray[i].arrow_direction = 'no'+If_gray+Progress; SyncTreeArray[i].radio = 'unactive'; SyncTreeArray[i].radio_handler = 'onclick=OnArrowClick("'+solution.objID+'","'+SyncTreeArray[i].id+'") style="cursor:hand"'; if(SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].radio_handler = ''; SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } if (SyncTreeArray[i].SyncItemCharacteristics.if_syncability == false) { SyncTreeArray[i].radio_handler = ''; SyncTreeArray[i].arrow_direction = 'no'+'_gray'; Menu_handlers_on = false; If_gray = '_gray'; } } SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); i++; } //----------------------------------------------------------- var SyncTreeList_length = i; if(Missing_active == true) { for(i=0; i<SyncTreeList_length; i++) { if(SyncTreeArray[i].arrow_direction == 'in'+If_gray+Progress) { SyncTreeArray[i].arrow_direction = 'del'+If_gray+Progress; } } } //---------------------------------------------------------- if(WinningTreeID == CONST_WIN_DEL_SYNC) { for(i=0; i<SyncTreeList_length; i++) { if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } else SyncTreeArray[i].arrow_direction = 'del'+If_gray+Progress; } } //---------------------------------------------------------- // New! if(WinningTreeID == CONST_WIN_NO_SYNC) { for(i=0; i<SyncTreeList_length; i++) { if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) { SyncTreeArray[i].arrow_direction = 'no'+'_gray'; } else SyncTreeArray[i].arrow_direction = 'no'+If_gray+Progress; } } //---------------------------------------------------------- if (SyncTreeList_length == 2) { message_tbody_element.if_dont_sync = Radio_dont_sync; message_tbody_element.if_del_sync = Radio_del_sync; message_tbody_element.msg_type = "2"; message_tbody_element.exist = "true"; var main_line_element = message_tbody_element.insertRow(); main_line_element.className = 'Single_row'; //---------------------------------------- CreateSyncItemCharacteristicsTD(main_line_element, SyncTreeArray[0].SyncItemCharacteristics); //---------------------------------------- Left_radio_element = main_line_element.insertCell(); Left_radio_element.className = "Left_cell"; //---------------------------------------- Left_arrow_element = main_line_element.insertCell(); Left_arrow_element.height = "100%"; Left_arrow_element.innerHTML = '<div id="Base_'+MsgObj.objID+'" class="Back_plate"><div class="Arrow_left_'+SyncTreeArray[0].arrow_direction+'"></div></div>'; //---------------------------------------- Mid_arrow_element = main_line_element.insertCell(); Mid_arrow_element.height = "100%"; Mid_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_mid_single'+If_gray+'" ></div></div>'; //---------------------------------------- Right_arrow_element = main_line_element.insertCell(); Right_arrow_element.height = "100%"; Right_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_right_'+SyncTreeArray[1].arrow_direction+'"></div></div>'; //---------------------------------------- Right_radio_element = main_line_element.insertCell(); Right_radio_element.className = "Right_cell"; //---------------------------------------- CreateSyncItemCharacteristicsTD(main_line_element, SyncTreeArray[1].SyncItemCharacteristics); //---------------------------------------- if(Menu_handlers_on == true) { var Gray0 = ''; var Gray1 = ''; if (SyncTreeArray[0].SyncItemCharacteristics.if_available == false) Gray0 = '_gray'; if (SyncTreeArray[1].SyncItemCharacteristics.if_available == false) Gray1 = '_gray'; //---------------------------------------- Left_radio_element.onmouseenter = ShowFM; Left_radio_element.onmouseleave = HideFM; Left_radio_element.onclick = OnPopupClick; Left_radio_element.oncontextmenu = OnPopupContextMenu; Left_radio_element.msg_id = MsgObj.objID; Left_radio_element.collection_id = CollectionID; Left_radio_element.innerHTML = '<img src="Pics/Radio_left_'+SyncTreeArray[0].radio+Gray0+'.gif" class="Radio_control" '+SyncTreeArray[0].radio_handler+'>'; //---------------------------------------- Left_arrow_element.onmouseenter = ShowFM; Left_arrow_element.onmouseleave = HideFM; Left_arrow_element.onclick = OnPopupClick; Left_arrow_element.oncontextmenu = OnPopupContextMenu; Left_arrow_element.msg_id = MsgObj.objID; Left_arrow_element.collection_id = CollectionID; //---------------------------------------- Mid_arrow_element.onmouseenter = ShowFM; Mid_arrow_element.onmouseleave = HideFM; Mid_arrow_element.onclick = OnPopupClick; Mid_arrow_element.oncontextmenu = OnPopupContextMenu; Mid_arrow_element.msg_id = MsgObj.objID; Mid_arrow_element.collection_id = CollectionID; //---------------------------------------- Right_radio_element.onmouseenter = ShowFM; Right_radio_element.onmouseleave = HideFM; Right_radio_element.onclick = OnPopupClick; Right_radio_element.oncontextmenu = OnPopupContextMenu; Right_radio_element.msg_id = MsgObj.objID; Right_radio_element.collection_id = CollectionID; Right_radio_element.innerHTML = '<img src="Pics/Radio_right_'+SyncTreeArray[1].radio+Gray1+'.gif" class="Radio_control" '+SyncTreeArray[1].radio_handler+'>'; //---------------------------------------- Right_arrow_element.onmouseenter = ShowFM; Right_arrow_element.onmouseleave = HideFM; Right_arrow_element.onclick = OnPopupClick; Right_arrow_element.oncontextmenu = OnPopupContextMenu; Right_arrow_element.msg_id = MsgObj.objID; Right_arrow_element.collection_id = CollectionID; } else { Left_radio_element.innerHTML = '<div class="Without_radio"></div>'; Right_radio_element.innerHTML = '<div class="Without_radio"></div>'; } } if (SyncTreeList_length > 2) { message_tbody_element.if_dont_sync = Radio_dont_sync; message_tbody_element.if_del_sync = Radio_del_sync; message_tbody_element.msg_type = "3"; message_tbody_element.exist = "true"; //First row var first_row_element = message_tbody_element.insertRow(); first_row_element.className = 'First_row'; CreateSyncItemCharacteristicsTD(first_row_element, SyncTreeArray[0].SyncItemCharacteristics); Left_radio_element = first_row_element.insertCell(); Left_radio_element.className = "Left_cell"; Left_arrow_element = first_row_element.insertCell(); Left_arrow_element.height = "100%"; Left_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_left_'+SyncTreeArray[0].arrow_direction+'"></div></div>'; Mid_arrow_element = first_row_element.insertCell(); Mid_arrow_element.height = "100%"; Mid_arrow_element.innerHTML = '<div id="Base_up_'+MsgObj.objID+'" class="Back_plate"><div class="Arrow_mid_top'+If_gray+'" ></div></div>'; Right_arrow_element = first_row_element.insertCell(); Right_arrow_element.height = "100%"; Right_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_right_'+SyncTreeArray[1].arrow_direction+'"></div></div>'; Right_radio_element = first_row_element.insertCell(); Right_radio_element.className = "Right_cell"; if(Menu_handlers_on == true) { Left_radio_element.onmouseenter = ShowFM; Left_radio_element.onmouseleave = HideFM; Left_radio_element.onclick = OnPopupClick; Left_radio_element.oncontextmenu = OnPopupContextMenu; Left_radio_element.msg_id = MsgObj.objID; Left_radio_element.collection_id = CollectionID; var Gray = ''; if (SyncTreeArray[0].SyncItemCharacteristics.if_available == false) Gray = '_gray'; Left_radio_element.innerHTML = '<img src="Pics/Radio_left_'+SyncTreeArray[0].radio+Gray+'.gif" class="Radio_control" '+SyncTreeArray[0].radio_handler+'>'; Left_arrow_element.onmouseenter = ShowFM; Left_arrow_element.onmouseleave = HideFM; Left_arrow_element.onclick = OnPopupClick; Left_arrow_element.oncontextmenu = OnPopupContextMenu; Left_arrow_element.msg_id = MsgObj.objID; Left_arrow_element.collection_id = CollectionID; Mid_arrow_element.onmouseenter = ShowFM; Mid_arrow_element.onmouseleave = HideFM; Mid_arrow_element.onclick = OnPopupClick; Mid_arrow_element.oncontextmenu = OnPopupContextMenu; Mid_arrow_element.msg_id = MsgObj.objID; Mid_arrow_element.collection_id = CollectionID; Right_arrow_element.onmouseenter = ShowFM; Right_arrow_element.onmouseleave = HideFM; Right_arrow_element.onclick = OnPopupClick; Right_arrow_element.oncontextmenu = OnPopupContextMenu; Right_arrow_element.msg_id = MsgObj.objID; Right_arrow_element.collection_id = CollectionID; Right_radio_element.onmouseenter = ShowFM; Right_radio_element.onmouseleave = HideFM; Right_radio_element.onclick = OnPopupClick; Right_radio_element.oncontextmenu = OnPopupContextMenu; Right_radio_element.msg_id = MsgObj.objID; Right_radio_element.collection_id = CollectionID; if (SyncTreeArray[1].SyncItemCharacteristics.if_available == false) Gray = '_gray'; Right_radio_element.innerHTML = '<img src="Pics/Radio_right_'+SyncTreeArray[1].radio+Gray+'.gif" class="Radio_control" '+SyncTreeArray[1].radio_handler+'>'; } else { Left_radio_element.innerHTML = '<div class="Without_radio"></div>'; Right_radio_element.innerHTML = '<div class="Without_radio"></div>'; } CreateSyncItemCharacteristicsTD(first_row_element, SyncTreeArray[1].SyncItemCharacteristics); for(i=2; i<SyncTreeList_length-1; i++) //Middle rows { var middle_row_element = message_tbody_element.insertRow(); middle_row_element.className = 'Mid_row'; CreateSyncItemCharacteristicsTD(middle_row_element, null); Left_radio_element = middle_row_element.insertCell(); Left_radio_element.className = "Left_cell"; Left_radio_element.innerHTML = ''; Left_arrow_element = middle_row_element.insertCell(); Left_arrow_element.height = "100%"; Left_arrow_element.innerHTML = '<div class="Back_plate"></div>'; Mid_arrow_element = middle_row_element.insertCell(); Mid_arrow_element.height = "100%"; Mid_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_mid_mid'+If_gray+'" ></div>'; Right_arrow_element = middle_row_element.insertCell(); Right_arrow_element.height = "100%"; Right_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_right_'+SyncTreeArray[i].arrow_direction+'"></div></div>'; Right_radio_element = middle_row_element.insertCell(); Right_radio_element.className = "Right_cell"; if(Menu_handlers_on == true) { Left_radio_element.onmouseenter = ShowFM; Left_radio_element.onmouseleave = HideFM; Left_radio_element.onclick = OnPopupClick; Left_radio_element.oncontextmenu = OnPopupContextMenu; Left_radio_element.msg_id = MsgObj.objID; Left_radio_element.collection_id = CollectionID; Left_arrow_element.onmouseenter = ShowFM; Left_arrow_element.onmouseleave = HideFM; Left_arrow_element.onclick = OnPopupClick; Left_arrow_element.oncontextmenu = OnPopupContextMenu; Left_arrow_element.msg_id = MsgObj.objID; Left_arrow_element.collection_id = CollectionID; Mid_arrow_element.onmouseenter = ShowFM; Mid_arrow_element.onmouseleave = HideFM; Mid_arrow_element.onclick = OnPopupClick; Mid_arrow_element.oncontextmenu = OnPopupContextMenu; Mid_arrow_element.msg_id = MsgObj.objID; Mid_arrow_element.collection_id = CollectionID; Right_arrow_element.onmouseenter = ShowFM; Right_arrow_element.onmouseleave = HideFM; Right_arrow_element.onclick = OnPopupClick; Right_arrow_element.oncontextmenu = OnPopupContextMenu; Right_arrow_element.msg_id = MsgObj.objID; Right_arrow_element.collection_id = CollectionID; Right_radio_element.onmouseenter = ShowFM; Right_radio_element.onmouseleave = HideFM; Right_radio_element.onclick = OnPopupClick; Right_radio_element.oncontextmenu = OnPopupContextMenu; Right_radio_element.msg_id = MsgObj.objID; Right_radio_element.collection_id = CollectionID; var Gray = ''; if (SyncTreeArray[i].SyncItemCharacteristics.if_available == false) Gray = '_gray'; Right_radio_element.innerHTML = '<img src="Pics/Radio_right_'+SyncTreeArray[i].radio+Gray+'.gif" class="Radio_control" '+SyncTreeArray[i].radio_handler+'>'; } else { Right_radio_element.innerHTML = '<div class="Without_radio"></div>'; } CreateSyncItemCharacteristicsTD(middle_row_element, SyncTreeArray[i].SyncItemCharacteristics); } //Last row var last_row_element = message_tbody_element.insertRow(); last_row_element.className = 'Last_row'; CreateSyncItemCharacteristicsTD(last_row_element, null); Left_radio_element = last_row_element.insertCell(); Left_radio_element.className = "Left_cell"; Left_radio_element.innerHTML = ''; Left_arrow_element = last_row_element.insertCell(); Left_arrow_element.height = "100%"; Left_arrow_element.innerHTML = '<div class="Back_plate"></div>'; Mid_arrow_element = last_row_element.insertCell(); Mid_arrow_element.height = "100%"; Mid_arrow_element.innerHTML = '<div id="Base_down_'+MsgObj.objID+'" class="Back_plate"><div class="Arrow_mid_bottom'+If_gray+'" ></div>'; Right_arrow_element = last_row_element.insertCell(); Right_arrow_element.height = "100%"; Right_arrow_element.innerHTML = '<div class="Back_plate"><div class="Arrow_right_'+SyncTreeArray[SyncTreeList_length-1].arrow_direction+'"></div></div>'; Right_radio_element = last_row_element.insertCell(); Right_radio_element.className = "Right_cell"; if(Menu_handlers_on == true) { Left_radio_element.onmouseenter = ShowFM; Left_radio_element.onmouseleave = HideFM; Left_radio_element.onclick = OnPopupClick; Left_radio_element.oncontextmenu = OnPopupContextMenu; Left_radio_element.msg_id = MsgObj.objID; Left_radio_element.collection_id = CollectionID; Left_arrow_element.onmouseenter = ShowFM; Left_arrow_element.onmouseleave = HideFM; Left_arrow_element.onclick = OnPopupClick; Left_arrow_element.oncontextmenu = OnPopupContextMenu; Left_arrow_element.msg_id = MsgObj.objID; Left_arrow_element.collection_id = CollectionID; Mid_arrow_element.onmouseenter = ShowFM; Mid_arrow_element.onmouseleave = HideFM; Mid_arrow_element.onclick = OnPopupClick; Mid_arrow_element.oncontextmenu = OnPopupContextMenu; Mid_arrow_element.msg_id = MsgObj.objID; Mid_arrow_element.collection_id = CollectionID; Right_arrow_element.onmouseenter = ShowFM; Right_arrow_element.onmouseleave = HideFM; Right_arrow_element.onclick = OnPopupClick; Right_arrow_element.oncontextmenu = OnPopupContextMenu; Right_arrow_element.msg_id = MsgObj.objID; Right_arrow_element.collection_id = CollectionID; Right_radio_element.onmouseenter = ShowFM; Right_radio_element.onmouseleave = HideFM; Right_radio_element.onclick = OnPopupClick; Right_radio_element.oncontextmenu = OnPopupContextMenu; Right_radio_element.msg_id = MsgObj.objID; Right_radio_element.collection_id = CollectionID; var Gray = ''; if (SyncTreeArray[SyncTreeList_length-1].SyncItemCharacteristics.if_available == false) Gray = '_gray'; Right_radio_element.innerHTML = '<img src="Pics/Radio_right_'+SyncTreeArray[SyncTreeList_length-1].radio+Gray+'.gif" class="Radio_control" '+SyncTreeArray[SyncTreeList_length-1].radio_handler+'>'; } else { Right_radio_element.innerHTML = '<div class="Without_radio"></div>'; } CreateSyncItemCharacteristicsTD(last_row_element, SyncTreeArray[SyncTreeList_length-1].SyncItemCharacteristics); } } else // Message is not sync item { var itemId_in_sync_item_collection = MsgObj.Method0('M_GetLinkID'); //var link_to_sync_item = ''; if(CONST_CID != itemId_in_sync_item_collection) { var link_to_sync_item = ''; //'<span style="cursor:hand; color:blue; margin-left:15px; text-decoration: underline;" '+ //'onmouseover="OnMouseOverPath()" onmouseout="OnMouseOutPath()" '+ //'onclick=LinkToCollectionMsg("All","'+itemId_in_sync_item_collection+'")>'+ //external.LS('tooltip_goto_sync_item')+'</span>'; } else { var link_to_sync_item = ''; } message_tbody_element.exist = "true"; message_tbody_element.oncontextmenu=OnMsgContextMenu; var single_row_element = message_tbody_element.insertRow(); single_row_element.className = 'Single_row'; mainline_cell_element = single_row_element.insertCell(); mainline_cell_element.className="info_msg"; mainline_cell_element.colSpan="11"; mainline_cell_element.innerHTML = '<span id="Link'+CollectionID+MsgObj.objID+'"></span>'+ MsgObj.ToString()+ CreateMsgButtons(MsgObj)+ link_to_sync_item; return; } } // -------------------------------------------------------------------------------- // create HTML container for sync item according "SyncItemCharacteristics" variable // -------------------------------------------------------------------------------- function CreateSyncItemCharacteristicsHTML(SyncItemCharacteristics) { // var name = ''; var size = ''; var size_title = ''; var time = ''; var time_title = ''; var state = ''; var state_style = ''; if (SyncItemCharacteristics != null) { if(SyncItemCharacteristics.state == '') { name = SyncItemCharacteristics.name; size = SyncItemCharacteristics.size; size_title = external.LS("tooltip_file_size"); time = SyncItemCharacteristics.time; time_title = external.LS("tooltip_file_time"); } if(SyncItemCharacteristics.state != '') { name = SyncItemCharacteristics.name; state = SyncItemCharacteristics.state; if(SyncItemCharacteristics.if_missing == true) state_style = 'style="color:red"'; if(SyncItemCharacteristics.if_syncability == false) state_style = 'style="color:gray"'; if (SyncItemCharacteristics.if_available == false) state_style = 'style="color:gray"'; } } var name_html = '<td width="50%" class="SyncAttrName">' + name + '</td>'; var size_html = '<td title="'+size_title+'" class="SyncAttrSize" ><span style="width:40px">' + size + '</span></td>'; var time_html = '<td nowrap class="SyncAttribute" title="'+time_title+'" ><span style="width:90px">' + time + '</span></td>'; var state_html= '<td class="SyncAttrState" colspan="2" valign="middle" align="center" nowrap '+ state_style +' >'+ '<span style="width:137px">'+ state + '</span></td>'; if(state != '') Item_html = name_html + state_html; else Item_html = name_html + size_html + time_html; return Item_html; } function CreateSyncItemCharacteristicsTD(Row_element, SyncItemCharacteristics) { if(SyncItemCharacteristics == null) { name_element = Row_element.insertCell(); name_element.width="50%"; name_element.className="SyncAttrName"; name_element.innerHTML = ''; size_element = Row_element.insertCell(); size_element.className="SyncAttrSize"; size_element.innerHTML = '<span style="width:40px"></span>'; time_element = Row_element.insertCell(); time_element.className="SyncAttribute"; time_element.noWrap = true; time_element.innerHTML = '<span style="width:90px"></span>'; return; } if(SyncItemCharacteristics.state == '') { name_element = Row_element.insertCell(); name_element.width="50%"; name_element.className="SyncAttrName"; name_element.innerHTML = SyncItemCharacteristics.name; size_element = Row_element.insertCell(); size_element.className="SyncAttrSize"; size_element.title = external.LS("tooltip_file_size"); size_element.innerHTML = '<span style="width:40px">'+SyncItemCharacteristics.size+'</span>'; time_element = Row_element.insertCell(); time_element.className="SyncAttribute"; time_element.noWrap = true; time_element.title = external.LS("tooltip_file_time"); time_element.innerHTML = '<span style="width:90px">'+SyncItemCharacteristics.time+'</span>'; } else { name_element = Row_element.insertCell(); name_element.className="SyncAttrName"; name_element.width="50%"; name_element.innerHTML = SyncItemCharacteristics.name; state_element = Row_element.insertCell(); state_element.className="SyncAttrState"; state_element.colSpan="2"; state_element.align="center"; state_element.noWrap=true; if(SyncItemCharacteristics.if_missing == true) { state_element.style.color="red"; if (SyncItemCharacteristics.if_syncability == false) state_element.style.color="gray"; } else if (SyncItemCharacteristics.if_available == false) { state_element.style.color="gray"; //if (SyncItemCharacteristics.if_syncability == true) state_element.style.color="red"; } state_element.innerHTML = '<span style="width:137px">'+SyncItemCharacteristics.state+'</span>'; } return; } function ExtAddNewMsg(MsgCollectionObjID, MsgObjID, InsertPosition) { if (G_Collection_lock == true) return; var msg = external.ObjByID(MsgObjID); if(msg != null) { var Assoc = msg.GetM('m_SlnDoAssocSyncWPtr'); var AssocID = Assoc.objID; if(G_Assocs[AssocID].TreeView._collections[MsgCollectionObjID] != null) G_Assocs[AssocID].TreeView.add_message_node(MsgCollectionObjID, MsgObjID, InsertPosition); } } function ExtChangeMsg(MsgCollectionObjID, MsgObjID) { if (G_Collection_lock == true) return; if((G_Above_message.msg_id == MsgObjID) && (G_Above_message.collection_id == MsgCollectionObjID)) G_Above_message.mustshown = false; G_Shown_message.collection_id = null; G_Shown_message.msg_id = null; //------------------------------------ var msg = external.ObjByID(MsgObjID); if(msg == null) return; //------------------------------------ var AssocID = msg.GetM('m_SlnDoAssocSyncWPtr').objID; if(G_Assocs[AssocID].TreeView._collections[MsgCollectionObjID] == null) return; //------------------------------------ var collection_container = document.getElementById('Assoc_'+AssocID).all[MsgCollectionObjID+'_container']; //------------------------------------ var message_element = collection_container.children[MsgObjID]; if(message_element == null) { return; } else if(message_element.exist == 'false') { return; } //------------------------------------ if(message_element.className.match(/Msg_Odd/)) MsgEvenness = 1; else MsgEvenness = 0; BuildMessageAsObject(message_element, MsgCollectionObjID, MsgObjID, MsgEvenness); } //-------------------------------------------------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------------------------------- function OpenSyncRoot(SyncTreeID) { external.Method1ID('M_OpenButtonPressedForTree', SyncTreeID); } // ------------------------------------------------------------------------------------------------ // create an object // ------------------------------------------------------------------------------------------------ function CreateSyncItemCharacteristics(solution, SuperTree_Obj, CollectionID) { // -------------------------------------------------------------------------------------------- // picture for item (syncitem (by default), file, folder, link to important message) this.picture = '<img src="Pics/SyncItem.gif" style="margin-right:5px;">'; this.name = ''; // path to Sync Item this.size = ''; // size of Sync Item (file) this.time = ''; // time of Sync Item (file) this.state = ''; // AfterSyncState is one of three - created, deleted, modified this.if_missing = false; // if the file does not exist in this.if_available = true; // if the file is available for processing this.if_syncability = solution.Method0('M_GetAvailableItemForSynchronization'); // item will be synced or not // -------------------------------------------------------------------------------------------- var str_not_available = false; var file_SIC = solution.Method1Own('M_GetSyncItemCharacteristicsBySuperTree', SuperTree_Obj); var Tree_Is_Ready = SuperTree_Obj.Method0('M_IsTreeReady'); // ------------------------------------------------------------------------------------------------- // if item is not available // ------------------------------------------------------------------------------------------------- if (Tree_Is_Ready == false) str_not_available = true; if (file_SIC == null) str_not_available = true; if (str_not_available == true) { this.if_available = false; this.state = external.LS("str_not_available"); var is_dir1 = solution.Method0('M_IsCanHaveChildren'); if(is_dir1) this.picture = '<img src="Pics/FolderGray.gif" style="margin-right:5px;">'; else this.picture = '<img src="Pics/FileGray.gif" style="margin-right:5px;">'; this.name = this.picture+'<div style="color:gray" >'+solution.Method1('M_CreateFullPathStrBySuperTree', SuperTree_Obj)+'</div>'; this.name = this.name.replace(/\\/g,"\\<wbr>"); return this; } //--------------------------------------------------------------------------------------------------- var SyncTreeObject = SuperTree_Obj.GetFirst(); var SyncRootPath = SyncTreeObject.Method0Own('M_ToFilename'); var levels_of_item_path_collection = solution.Method1Own('M_GetItemCollection', SuperTree_Obj); if(CONST_ShowFullFileName == false) SyncRootPath = ''; //--------------------------------------------------------------------------------------------------- // Creating clickable parts of path // -------------------------------------------------------------------------------------------------- var path = '<span onclick="OpenSyncRoot(\''+SyncTreeObject.objID+ '\')" onmouseover="OnMouseOverPath()" onmouseout="OnMouseOutPath()" style="cursor:hand;" '+ 'title="'+external.LS("tooltip_open_the_rootfolder")+'">'+ SyncRootPath+'</span>'; var level_of_item_path = levels_of_item_path_collection.GetFirst(); while(level_of_item_path != null) { var part_of_item_path = level_of_item_path.Method0('M_ToFilename'); if(level_of_item_path.Method1('M_GetItemExistenceBySuperTree', SuperTree_Obj) == false) { path += '\\<wbr><span style="color:gray" >'+part_of_item_path+'</span>'; } else { path += '\\<wbr><span onclick="ShowItem(\''+level_of_item_path.objID+'\', \''+SuperTree_Obj.objID+'\')" '; path += 'onmouseover="OnMouseOverPath()" onmouseout="OnMouseOutPath()" style="cursor:hand;" '+ 'title="'+external.LS("tooltip_open_the_item")+'" >'+part_of_item_path+'</span>'; } level_of_item_path = levels_of_item_path_collection.GetNext(level_of_item_path); } this.name = path; // -------------------------------------------------------------------------------------------------- // End of Creating clickable parts of path // -------------------------------------------------------------------------------------------------- var is_not_exist = file_SIC.GetM('m_bMissing'); var SolutionActionState = solution.Method0('M_GetActionState');//DU solution.GetM('MM_ActionState'); if(SolutionActionState == CONST_ACTION_STATE_DONE) { var AfterActionState = solution.Method1Own('M_GetActionDoneUserStrBySuperTree', SuperTree_Obj); if(AfterActionState != null) this.state = AfterActionState; } //---------------------------------------------------- var itemPicture = ''; var itemTooltip = ''; var is_dir = solution.Method0('M_IsCanHaveChildren'); var itemId_in_important_collection = solution.Method0('M_GetLinkID'); //---------------------------------------------------- if (is_dir) { this.size = external.LS('str_folder'); itemTooltip = external.LS("tooltip_open_the_folder"); if (is_not_exist) itemPicture = "Pics/FolderGray.gif"; else itemPicture = "Pics/Folder.gif"; } else // if item is file { var file_size = file_SIC.Method0('M_GetFileSizeStr'); if(file_size != null) this.size = file_size; itemTooltip = external.LS("tooltip_open_the_file"); if (is_not_exist) itemPicture = "Pics/FileGray.gif"; else { // if the item has link to "important message" if(CONST_CID != itemId_in_important_collection) { itemPicture = "Pics/Warning_small.gif"; itemTooltip = external.LS("tooltip_goto_important_message"); } else itemPicture = "Pics/File.gif"; } } if (is_not_exist) { //alert(this.state + '-'); if (this.state != external.LS("str_deleted")) // made by Core this.state = external.LS("str_not_exist"); this.if_missing = true; this.picture = '<img src="'+itemPicture+'" style="margin-right:5px;">'; this.name = this.picture + this.name; return this; } else { var file_time = file_SIC.Method0('M_GetFiletimeStr'); if(file_time != null) this.time = file_time; level_of_item_path = levels_of_item_path_collection.GetLast(); // if the item has link to "important message" if(CONST_CID != itemId_in_important_collection) { this.picture = '<img src="'+itemPicture+'" '+ 'id="Link'+CollectionID+solution.ObjID+'"'+ 'title="'+itemTooltip+'" '+ 'style="cursor:hand; margin-right:5px;" '+ 'onclick=LinkToCollectionMsg("Important","'+itemId_in_important_collection+'")>'; } else { this.picture = '<img src="'+itemPicture+'" style="cursor:hand; margin-right:5px;"'+ 'title="'+itemTooltip+'" '+ 'onclick="ShowItem(\''+level_of_item_path.objID+'\', \''+SuperTree_Obj.objID+'\')">'; } } //----------------------------------------------------- this.name = this.picture + this.name; return this; } function ShowItem(SolutionID, SuperTreeID) { external.ShowItem(SuperTreeID, SolutionID); } function CreateMsgButtons(MsgObj) { var msg_buttons = MsgObj.GetObjM('m_UserButtonsPtr'); buttons_html = ""; if(msg_buttons != null) { buttons_html += "<br/>"; var button = msg_buttons.GetFirst(); //------------------------------------------------------------------------------------------ var button_Type = button.Method0('M_GetType'); buttons_html += '<span style="white-space:nowrap; padding-left:20px;">'; //------------------------------------------------------------------------------------------ while(button != null) { if (button_Type == 0) // Button is button { buttons_html += '<BUTTON onclick=OnMsgButton("'+button.objID+'") class="msg_button">' + button.ToString() + '</BUTTON>'; } else if (button_Type == 1) // button is text link { buttons_html += '<span '+ 'onmouseover=OnMouseOverPath() onmouseout=OnMouseOutPath() '+ 'onclick=OnMsgButton("'+button.objID+'") '+ 'style="cursor:hand; color:blue; margin-left:15px; text-decoration: underline;">'+ ''+button.ToString()+''+'</span>'; } button = msg_buttons.GetNext(button); if (button != null) button_Type = button.Method0('M_GetType'); } buttons_html += '</span>'; } return buttons_html; } function OnArrowClick(SolutionID, TreeID) { var solution = external.ObjByID(SolutionID); solution.Method1ID('M_AlternativeSelected',TreeID); } function OnMsgButton(button_objID) { external.Method1('M_ButtonPressed', button_objID); } function Ok_Activate(num) { Form_elem = document.getElementById('Assoc_'+G_ActiveAssocID).all["TreeForm"+num]; SyncTreeID = Form_elem.parentElement.synctree_id; new_path = Form_elem.all[SyncTreeID+'_path'].value; if(Form_elem.is_empty == "false") { old_path = external.ObjByID(SyncTreeID).Method0Own('M_ToFilename'); } else { old_path = ""; } if(new_path != old_path) { Form_elem.all["TreeOk"+num].disabled = false; Form_elem.all["TreeCancel"+num].disabled = false; Form_elem.all["TreeOk"+num].style.backgroundImage = "url(Pics/Folder_button.gif)"; Form_elem.all["TreeCancel"+num].style.backgroundImage = "url(Pics/Folder_button.gif)"; Form_elem.all["TreeOk"+num].style.cursor = "hand"; Form_elem.all["TreeCancel"+num].style.cursor = "hand"; Form_elem.is_changed = "true"; } else { Form_elem.all["TreeOk"+num].disabled = true; Form_elem.all["TreeCancel"+num].disabled = true; Form_elem.all["TreeOk"+num].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; Form_elem.all["TreeCancel"+num].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; Form_elem.all["TreeOk"+num].style.cursor = "none"; Form_elem.all["TreeCancel"+num].style.cursor = "none"; Form_elem.is_changed = "false"; } } // ------------------------------------------------------------------------------ // get SyncTree condition from profile // ------------------------------------------------------------------------------ function GetBackSyncBoard(num) { SyncTree_elem = document.getElementById('Assoc_'+G_ActiveAssocID).all["SyncTree"+num]; SyncTreeID = SyncTree_elem.synctree_id; SyncTreeObj = external.ObjByID(SyncTreeID); if(SyncTreeObj.Method0('M_IsTreeReady') == 1) { SyncTree_path = SyncTreeObj.Method0Own('M_ToFilename'); if_empty = "false"; } else { SyncTree_path =""; if_empty = "true"; } SyncTree_elem.all[SyncTreeID+"_path"].value = SyncTree_path; SyncTree_elem.all["TreeForm"+num].is_changed = "false"; SyncTree_elem.all["TreeForm"+num].is_empty = if_empty; SyncTree_elem.all["TreeOk"+num].disabled = true; SyncTree_elem.all["TreeCancel"+num].disabled = true; SyncTree_elem.all["TreeOk"+num].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_elem.all["TreeCancel"+num].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_elem.all["TreeOk"+num].style.cursor = "none"; SyncTree_elem.all["TreeCancel"+num].style.cursor = "none"; } // ------------------------------------------------------------------------------ // reload profile by core call // ------------------------------------------------------------------------------ function ExtOnProfileChanged() { if(Flag_can_reload_profile == false) { return; } RemoveAllAssocsFromScreen(); LoadProfile(); ActivateAssoc(G_ActiveAssocID); UpdateButtons(G_ActiveAssocID); ResizeWindow(); } // ------------------------------------------------------------------------- function Activate_form(num) { SyncTree_obj = document.getElementById('Assoc_'+G_ActiveAssocID).all["SyncTree"+num]; { SyncTree_obj.className = "Active_panel"; } } // ------------------------------------------------------------------------- function CancelSyncTree(num) { var SyncTree_elem = document.getElementById('Assoc_'+G_ActiveAssocID).all["SyncTree"+num]; SyncTree_elem.className = "Unactive_panel"; GetBackSyncBoard(num); } // ------------------------------------------------------------------------- function BrowseSyncTree(num) { var SyncTree_elem = document.getElementById('Assoc_'+G_ActiveAssocID).all["SyncTree"+num]; var SyncTreeID = SyncTree_elem.synctree_id; SyncTree_elem.className = "Unactive_panel"; G_OnProfileChanged_called = false; external.Method1ID('M_BrowseButtonPressedForTree', SyncTreeID); if(G_OnProfileChanged_called == false) { GetBackSyncBoard(num); } } // ------------------------------------------------------------------------- function OpenSyncTree(num) { SyncTree_elem = document.getElementById('Assoc_'+G_ActiveAssocID).all["SyncTree"+num]; SyncTreeID = SyncTree_elem.synctree_id; ChangeSyncTree(num); external.Method1ID('M_OpenButtonPressedForTree', SyncTreeID); } function FolderButtonSelect(button) { button.style.backgroundImage="url(Pics/Folder_button_selected.gif)"; } function FolderButtonUnselect(button) { button.style.backgroundImage="url(Pics/Folder_button.gif)"; } function MainButtonSelect(button) { button.style.backgroundImage="url(Pics/Main_button_selected.gif)"; } function MainButtonUnselect(button) { button.style.backgroundImage="url(Pics/Main_button.gif)"; } // ------------------------------------------------------------------------- // called after changing one of rootfolder names // ------------------------------------------------------------------------- function ChangeSyncTree(num) // spec.txt { ExtCloseHint(G_ActiveAssocID, "Syncpath_hint_"+num); AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); SyncTree_elem = AssocElement.all["SyncTree"+num]; SyncTreeID = SyncTree_elem.synctree_id; SyncTree_elem.className = "Unactive_panel"; Form_elem = AssocElement.all["TreeForm"+num]; // if the path is changed if(Form_elem.is_changed == "true") { Form_elem.is_changed = "false"; new_path = AssocElement.all[SyncTreeID+'_path'].value; // if path is changed to empty, return to path if (new_path == "") { SyncTreeObj = external.ObjByID(SyncTreeID); AssocElement.all[SyncTreeID+'_path'].value = SyncTreeObj.Method0Own('M_ToFilename'); new_path = AssocElement.all[SyncTreeID+'_path'].value; } G_Assocs[G_ActiveAssocID].OnAssocChangedCalled = false; var solution = external.method0Own('M_GetDoProfileSyncSolution'); solution.SafeChangeTreePathAndUpdateProfile(SyncTreeID, new_path); // if there are not changes get condition of SyncTree from profile if(G_Assocs[G_ActiveAssocID].OnAssocChangedCalled == false) { GetBackSyncBoard(num); } } return false; } // ------------------------------------------------------------------------- function Analyze_onclick() { AnalyzeButtonElement = window.event.srcElement; //AnalyzeButtonElement.style.backgroungImage='url(Pics/Main_button.gif)'; //AnalyzeButtonElement.style.backgroungImage='url(Pics/Main_button_off.gif)'; AssocID = AnalyzeButtonElement.association_id; ExtCloseHint(AssocID, 'Analyze_hint'); AssocObj = external.ObjByID(AssocID); AssocObj.CommandAnalyze(); } function Synchronize_onclick() { SynchronizeButtonElement = window.event.srcElement; AssocID = SynchronizeButtonElement.association_id; ExtCloseHint(AssocID, 'Analyze_hint'); // ExtCloseHint(AssocID, 'Synchronize_hint'); AssocObj = external.ObjByID(AssocID); AssocObj.CommandSynchronize(); } function Stop_onclick() { StopButtonElement = window.event.srcElement; AssocID = StopButtonElement.association_id; AssocObj = external.ObjByID(AssocID); AssocObj.CommandStop(); } function ExtBreakCollections(AssocID) { ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Important']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Information']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Questionable']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Deleted']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['New']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Changed']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Unchanged']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['All']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['Excluded']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['OverwriteByUser']); ExtBreakCollection(AssocID, G_Assocs[AssocID].TreeView._collectionIdByName['SyncFindItems']); } function ExtBreakCollection(AssocID, CollectionID) { CollectionObj = external.ObjByID(CollectionID); if((G_Assocs[AssocID].TreeView.root._children[CollectionID]._expanded == 1) && (CollectionObj.Method0('M_GetCount')>0)) { G_Assocs[AssocID].TreeView.click(CollectionID); } } function CloseAnalyzeHint() { AnalyzeButtonElement = window.event.srcElement; ExtCloseHint(AnalyzeButtonElement.association_id, 'Analyze_hint'); } function UpdateButtons(AssocID) { var AssocElement = document.getElementById('Assoc_'+AssocID); if(AssocElement == null) return; //---------------------------------------------------------------------------------- var AssocObj = external.ObjByID(AssocID); AssocElement.all['B_ANALYZE'].disabled = !AssocObj.StatusAnalyze; if (AssocElement.all['B_ANALYZE'].disabled) { AssocElement.all['B_ANALYZE'].style.backgroundImage ='url(Pics/Main_button_off.gif)'; AssocElement.all['B_ANALYZE'].style.cursor ='none'; } else { AssocElement.all['B_ANALYZE'].style.backgroundImage ='url(Pics/Main_button.gif)'; AssocElement.all['B_ANALYZE'].style.cursor ='hand'; } if(G_Assocs[AssocID].Folders_is_ready == true) { var FolderArray_length = G_Assocs[AssocID].Folder_is_ready_array.length; for(var i=0; i<FolderArray_length; i++) { DisableFSP(AssocID, i, !AssocObj.StatusAnalyze, true); } } else { var FolderArray_length = G_Assocs[AssocID].Folder_is_ready_array.length; for(var i=0; i<FolderArray_length; i++) { DisableFSP(AssocID, i, false, G_Assocs[AssocID].Folder_is_ready_array[i]); } } //------------------------------------------------------------------------------------ AssocElement.all['B_SYNC'].disabled = !AssocObj.StatusSynchronize; if (AssocElement.all['B_SYNC'].disabled) { AssocElement.all['B_SYNC'].style.backgroundImage ='url(Pics/Main_button_off.gif)'; AssocElement.all['B_SYNC'].style.cursor ='none'; } else { AssocElement.all['B_SYNC'].style.backgroundImage ='url(Pics/Main_button.gif)'; AssocElement.all['B_SYNC'].style.cursor ='hand'; } //------------------------------------------------------------------------------------ AssocElement.all['B_STOP'].disabled = !AssocObj.StatusStop; if (AssocElement.all['B_STOP'].disabled) { AssocElement.all['B_STOP'].style.backgroundImage ='url(Pics/Main_button_off.gif)'; AssocElement.all['B_STOP'].style.cursor ='none'; } else { AssocElement.all['B_STOP'].style.backgroundImage ='url(Pics/Main_button.gif)'; AssocElement.all['B_STOP'].style.cursor ='hand'; } //------------------------------------------------------------------------------------ } function UpdateButtonsTitle(AssocID, Status) { var AssocElement = document.getElementById('Assoc_'+AssocID); if (Status == STATUS_ATTRIBUTE_ANALYZING || Status == STATUS_ATTRIBUTE_SYNCHRONIZING) AssocElement.all['B_STOP'].innerText = external.LS("button_stop"); else AssocElement.all['B_STOP'].innerText = external.LS("button_clear"); } function UpdateAssocStatus(AssocID, status) { //--------------------------------------------------------------------------------------------------------- var AssocElement = document.getElementById('Assoc_'+AssocID); if(!AssocElement) return; //--------------------------------------------------------------------------------------------------------- var LabelCell = TabsLabels.cells['Label_'+AssocID]; if(!LabelCell) return;//DU: the association tab has not been added yet //--------------------------------------------------------------------------------------------------------- var SyncBoardsTable_element = AssocElement.all['SyncBoardsTable']; if (status == STATUS_ATTRIBUTE_ANALYZING) SyncBoardsTable_element.className = 'Analyze_State'; else if (status == STATUS_ATTRIBUTE_SYNCHRONIZING) SyncBoardsTable_element.className = 'Sync_State'; else SyncBoardsTable_element.className = 'Normal_State'; //--------------------------------------------------------------------------------------------------------- var LabelImg = LabelCell.all['Status_img']; if (status == 0) LabelImg.src = 'Pics/Status_normal.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC) LabelImg.src = 'Pics/Status_schedule.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC_INTERNAL) LabelImg.src = 'Pics/Status_schedule.gif'; else if (status == STATUS_ATTRIBUTE_AUTOMATIC_DISABLED) LabelImg.src = 'Pics/Status_manual.gif'; else if (status == STATUS_ATTRIBUTE_ANALYZING) LabelImg.src = 'Pics/Status_analyze.gif'; else if (status == STATUS_ATTRIBUTE_SYNCHRONIZING) LabelImg.src = 'Pics/Status_synchronize.gif'; else if (status == STATUS_ATTRIBUTE_INFORMATION_MESSAGE) LabelImg.src = 'Pics/Status_information.gif'; else if (status == STATUS_ATTRIBUTE_IMPORTANT_MESSAGE) LabelImg.src = 'Pics/Status_important.gif'; else if (status == STATUS_ATTRIBUTE_INCOMPLETE) LabelImg.src = 'Pics/Status_incomplete.gif'; //--------------------------------------------------------------------------------------------------------- UpdateButtonsTitle(AssocID, status); //--------------------------------------------------------------------------------------------------------- } function ExtOnStatusAttributeChanged(AssocID, StatusAttribute) //aaaa { var AssocObj = external.ObjByID(AssocID); var Status = AssocObj.Method0('M_GetAggregatedGeneralStatus'); if( StatusAttribute == STATUS_ATTRIBUTE_ANALYZE_ENABLED || StatusAttribute == STATUS_ATTRIBUTE_SYNCHRONIZE_ENABLED || StatusAttribute == STATUS_ATTRIBUTE_STOP_ENABLED) UpdateButtons(AssocID); else UpdateAssocStatus(AssocID, Status); if (AssocID == G_ActiveAssocID) ExtUpdateProgressBar(AssocID, external.Method0('M_GetProgressState'), external.Method0('M_GetProgressPercent')); // New !! } function DisableFSP(AssocID, FSPnum, if_disabled, Open_is_enabled) { var AssocElement2 = document.getElementById('Assoc_'+AssocID); var SyncTree_element = AssocElement2.all["SyncTree"+FSPnum]; SyncTree_element.all["TreePath"+FSPnum].disabled = if_disabled; SyncTree_element.all["TreeSubmitButtons"+FSPnum].disabled = if_disabled; SyncTree_element.all["TreeBrowse"+FSPnum].disabled = if_disabled; SyncTree_element.all["TreeOpen"+FSPnum].disabled = !Open_is_enabled; //----------------------------------------------------------------------------------------- if (SyncTree_element.all["TreeOk"+FSPnum].disabled) { SyncTree_element.all["TreeOk"+FSPnum].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_element.all["TreeOk"+FSPnum].style.cursor="none"; } else { SyncTree_element.all["TreeOk"+FSPnum].style.backgroundImage = "url(Pics/Folder_button.gif)"; SyncTree_element.all["TreeOk"+FSPnum].style.cursor="hand"; } //----------------------------------------------------------------------------------------- if (SyncTree_element.all["TreeCancel"+FSPnum].disabled) { SyncTree_element.all["TreeCancel"+FSPnum].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_element.all["TreeCancel"+FSPnum].style.cursor="none"; } else { SyncTree_element.all["TreeCancel"+FSPnum].style.backgroundImage = "url(Pics/Folder_button.gif)"; SyncTree_element.all["TreeCancel"+FSPnum].style.cursor="hand"; } //----------------------------------------------------------------------------------------- if (SyncTree_element.all["TreeOpen"+FSPnum].disabled) { SyncTree_element.all["TreeOpen"+FSPnum].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_element.all["TreeOpen"+FSPnum].style.cursor="none"; } else { SyncTree_element.all["TreeOpen"+FSPnum].style.backgroundImage = "url(Pics/Folder_button.gif)"; SyncTree_element.all["TreeOpen"+FSPnum].style.cursor="hand"; } //----------------------------------------------------------------------------------------- if (SyncTree_element.all["TreeBrowse"+FSPnum].disabled) { SyncTree_element.all["TreeBrowse"+FSPnum].style.backgroundImage = "url(Pics/Folder_button_off.gif)"; SyncTree_element.all["TreeBrowse"+FSPnum].style.cursor="none"; } else { SyncTree_element.all["TreeBrowse"+FSPnum].style.backgroundImage = "url(Pics/Folder_button.gif)"; SyncTree_element.all["TreeBrowse"+FSPnum].style.cursor="hand"; } //----------------------------------------------------------------------------------------- return; } function PlaceHintWindow(element, num) { if(element == null) { return; } var _left=-250; var _top=25; while(element.tagName!= 'BODY') { _left += element.offsetLeft; _top += element.offsetTop; element = element.offsetParent; } Hint_window.hint_number = num; Hint_window.style.left = _left; Hint_window.style.top = _top; } function ExtGiveHint(AssocID, Hint_element_id) { if(AssocID != G_ActiveAssocID) { return; } hint_element = document.getElementById('Assoc_'+AssocID).all[Hint_element_id]; if(Hint_element_id == "Syncpath_hint_0") { hint_width = hint_element.offsetWidth-17; close_left = hint_element.offsetWidth-15; hint_element.innerHTML = '<div style="position:absolute; top:0; left:0; width:25px; height:25px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'Pics/Hint_arrow1.png\'); z-index:10"></div>'+ '<div style="position:absolute; top:18; left:17; width:'+hint_width+'; padding:20px; background:cornsilk; border:solid 1px black; color: black;">'+ external.LS("hint_syncpath_left")+'</div>'+ '<img src="Pics/closehint.gif" onclick="ExtCloseHint(\''+AssocID+'\', \''+Hint_element_id+'\')" style="position:absolute; left:'+close_left+'px; top:18px;">'; hint_element.style.visibility = "inherit"; } else if(Hint_element_id == "Syncpath_hint_1") { hint_width = Hint_window.offsetWidth-17; arrow_left = Hint_window.offsetWidth-26; Hint_window.innerHTML = '<div style="position:absolute; top:0; left:'+arrow_left+'; width:25px; height:25px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'Pics/Hint_arrow2.png\'); z-index:10"></div>'+ '<div style="position:absolute; top:18; left:0; width:'+hint_width+'; padding:20px; background:cornsilk; border:solid 1px black; color: black;">'+ external.LS("hint_syncpath_right")+'</div>'+ '<img src="Pics/closehint.gif" onclick="ExtCloseHint(\''+AssocID+'\', \''+Hint_element_id+'\')" style="position:absolute; left:0px; top:18px;">'; Hint_window.style.visibility = "visible"; } else if(Hint_element_id == "Analyze_hint") { close_left = hint_element.offsetWidth+2; hint_element.innerHTML = '<div style="position:relative; top:0; left:17; padding:20px; background:cornsilk; border:solid 1px black; color: black;">'+ external.LS("hint_analyze")+'</div>'+ '<img src="Pics/closehint.gif" onclick="ExtCloseHint(\''+AssocID+'\', \''+Hint_element_id+'\')" style="position:absolute; left:'+close_left+'px; top:0px;">'+ '<div style="position:relative; left:0; right:0; width:250px; height:18px;">'+ '<div style="position:absolute; top:-8; left:0; width:25px; height:25px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'Pics/Hint_arrow3.png\'); z-index:10"></div></div>' hint_height = hint_element.offsetHeight; hint_element.style.top = -5-hint_height; hint_element.style.visibility = "inherit"; } else if(Hint_element_id == "Synchronize_hint") { hint_element.innerHTML = '<div style="position:relative; top:0; left:17; padding:20px; background:cornsilk; border:solid 1px black; color: black;">'+ external.LS("hint_synchronize")+'</div>'+ '<div style="position:relative; left:0; right:0; width:250px; height:18px;">'+ '<img src="Pics/Hint_arrow3.gif" style="position:absolute; top:-8; left:0; z-index:10"></div>' hint_height = hint_element.offsetHeight; hint_element.style.top = -5-hint_height; hint_element.style.visibility = "inherit"; } else { hint_width = Hint_window.offsetWidth-17; arrow_left = Hint_window.offsetWidth-26; Hint_window.innerHTML = '<div style="position:absolute; top:0; left:'+arrow_left+'; width:25px; height:25px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'Pics/Hint_arrow2.png\'); z-index:10"></div>'+ '<div style="position:absolute; top:18; left:0; width:'+hint_width+'; padding:20px; background:cornsilk; border:solid 1px black; color: black;">'+ external.LS("hint_syncpath_right")+'</div>'+ '<img src="Pics/closehint.gif" style="position:absolute; left:0px; top:18px;">'; Hint_window.style.visibility = "visible"; } } function ExtCloseHint(AssocID, Hint_element_id) { Hint_window.style.visibility = "hidden"; Hint_window.hint_number = ''; hint_element = document.getElementById('Assoc_'+AssocID).all[Hint_element_id]; if(hint_element != null) { hint_element.innerHTML = ""; hint_element.style.visibility = "hidden"; } } function ScrollToImportant() { AssocID = G_ActiveAssocID; ImportantID = G_Assocs[AssocID].TreeView._collectionIdByName['Important']; if(G_Assocs[AssocID].TreeView.root._children[ImportantID]._expanded == 0) { OnCollectionExpandIconClick(AssocID, ImportantID); } ImportantCollectionElement = document.getElementById('Assoc_'+AssocID).all[ImportantID]; ImportantCollectionElement.scrollIntoView(); } function ExtShowCollection(CollectionID) { var AssocID = G_ActiveAssocID; if(G_Assocs[AssocID].TreeView.root._children[CollectionID]._expanded == 0) { OnCollectionExpandIconClick(AssocID, CollectionID); } var CollectionElement = document.getElementById('Assoc_'+AssocID).all[CollectionID]; CollectionElement.scrollIntoView(); } function TabsCaptionResized() { if(TabsCaption.scrollLeft>0) { LeftTabScroller.src = "Pics/TabCaptionScroller1.gif"; LeftTabScroller.onmousedown = LeftTabScrollerDown; LeftTabScroller.onmouseup = TabScrollerReleased; LeftTabScroller.onmouseleave = TabScrollerReleased; } else { LeftTabScroller.src = "Pics/TabCaptionScroller0.gif"; LeftTabScroller.onmousedown = ''; } if(TabsCaption.scrollWidth-TabsCaption.clientWidth-TabsCaption.scrollLeft >0) { RightTabScroller.src = "Pics/TabCaptionScroller2.gif"; RightTabScroller.onmousedown = RightTabScrollerDown; RightTabScroller.onmouseup = TabScrollerReleased; RightTabScroller.onmouseleave = TabScrollerReleased; } else { RightTabScroller.src = "Pics/TabCaptionScroller0.gif"; RightTabScroller.onmousedown = ''; } } function TabLabelOnClick1(AssocID) { external.Method1('M_SelectAssoc', external.ObjByID(AssocID)); } function TabLabelContextMenu(AssocID) { window.event.cancelBubble = true; var AssocObj = external.ObjByID(AssocID); external.ShowContextMenu(AssocObj, CONST_CID); } //--------------------------------------------------------------------------------------- function ScrollTabLabelIntoView(AssocID) { LabelCell = TabsLabels.cells['Label_'+AssocID]; LeftLabelOut = TabsCaption.scrollLeft - LabelCell.offsetLeft+15; RightLabelOut = (LabelCell.offsetLeft+LabelCell.offsetWidth+16) - (TabsCaption.scrollLeft+TabsCaption.clientWidth); //---------------------------------------------------------------------------------------- if ((LeftLabelOut<0)&&(RightLabelOut<0))return; else if (LeftLabelOut<0) ScrollTabToPixels('Right', RightLabelOut); else if (RightLabelOut<0) ScrollTabToPixels('Left', LeftLabelOut); else if((LeftLabelOut>0)&&(RightLabelOut>0)) if(LeftLabelOut > RightLabelOut) ScrollTabToPixels('Right', RightLabelOut); else ScrollTabToPixels('Left', LeftLabelOut); } //--------------------------------------------------------------------------------------- function LeftTabScrollerDown() { G_TabScrollingProcessNum++; RightTabScroller.src = "Pics/TabCaptionScroller2.gif"; RightTabScroller.onmousedown = RightTabScrollerDown; RightTabScroller.onmouseup = TabScrollerReleased; RightTabScroller.onmouseleave = TabScrollerReleased; ScrollTabTo('Left', G_TabScrollingProcessNum); } function RightTabScrollerDown() { G_TabScrollingProcessNum++; LeftTabScroller.src = "Pics/TabCaptionScroller1.gif"; LeftTabScroller.onmousedown = LeftTabScrollerDown; LeftTabScroller.onmouseup = TabScrollerReleased; LeftTabScroller.onmouseleave = TabScrollerReleased; ScrollTabTo('Right', G_TabScrollingProcessNum); } function TabScrollerReleased() { G_TabScrollingProcessNum++; } //---------------------------------------------------------------------------------------- function ScrollTabTo(Direction, ProcessNum) { if(ProcessNum == G_TabScrollingProcessNum) { if(Direction == 'Left') if(TabsCaption.scrollLeft >5) { TabsCaption.scrollLeft -= 5; window.setTimeout("ScrollTabTo('Left',"+ProcessNum+")", 5); } else { TabsCaption.scrollLeft = 0; LeftTabScroller.src = "Pics/TabCaptionScroller0.gif"; LeftTabScroller.onmousedown = ''; } if(Direction == 'Right') if(TabsCaption.scrollWidth-TabsCaption.clientWidth-TabsCaption.scrollLeft >5) { TabsCaption.scrollLeft += 5; window.setTimeout("ScrollTabTo('Right',"+ProcessNum+")", 5); } else { TabsCaption.scrollLeft = TabsCaption.scrollWidth-TabsCaption.clientWidth; RightTabScroller.src = "Pics/TabCaptionScroller0.gif"; RightTabScroller.onmousedown = ''; } } } //--------------------------------------------------------------------------------------- function ScrollTabToPixels(Direction, PixelNumber) { if (Direction == 'Left') { if(PixelNumber > TabsCaption.scrollLeft) PixelNumber = TabsCaption.scrollLeft; TabsCaption.scrollLeft = TabsCaption.scrollLeft-PixelNumber; } if (Direction == 'Right') { var temp = TabsCaption.scrollWidth - TabsCaption.clientWidth - TabsCaption.scrollLeft; if(PixelNumber > temp) PixelNumber = temp; TabsCaption.scrollLeft = TabsCaption.scrollLeft+PixelNumber; } TabsCaptionResized(); } //--------------------------------------------------------------------------------------- function CloseAnalizeHint() { AnalyzeButtonElement = window.event.srcElement; AssocID = AnalyzeButtonElement.association_id; ExtCloseHint(AssocID, 'Analyze_hint'); } function ExtAddNewAssoc() { NewAssoc(); } // ------------------------------------------------------------------- // change active association for core // ------------------------------------------------------------------- function ExtSelectAssoc(AssocID) { DeactivateAssoc(G_ActiveAssocID); ActivateAssoc(AssocID); } // ------------------------------------------------------------------- // change name of active association for core // ------------------------------------------------------------------- function RenameAssoc() { ExtAskNewAssocName(G_ActiveAssocID); } function ExtAskNewAssocName(AssocID) { var AssocObj = external.ObjByID(AssocID); var OldName = AssocObj.Method0('M_GetAssocName'); var NewAssocName = prompt(external.LS("rename_association_prompt"), OldName); TabsLabels.cells['Label_'+AssocID].all['TabCaptionText'].innerText = AssocObj.Method1('M_SetAssocName', NewAssocName); } // ------------------------------------------------------- // alert ("Show middle menu for each item of each collections"); // ------------------------------------------------------- function ShowFM() { var Src_cell = window.event.srcElement; G_Above_message.msg_id = Src_cell.msg_id; G_Above_message.collection_id = Src_cell.collection_id; window.setTimeout("OpenMenu(\'"+Src_cell.msg_id+"\', \'"+Src_cell.collection_id+"\')", 250); } function HideFM() { if(G_Above_message.latch == false) { var Src_cell = window.event.srcElement; G_Above_message.msg_id = null; G_Above_message.collection_id = null; if(G_Above_message.mustshown == false) { window.setTimeout("LeadUp(\'"+Src_cell.msg_id+"\', \'"+Src_cell.collection_id+"\')", 10); } // Debug_window.innerHTML += (G_debug_line_number++)+' HideFM: Shown = '+G_Shown_message.msg_id+' Above = '+G_Above_message.msg_id+' : '+G_Above_message.mustshown+'<br>'; window.setTimeout("CloseMenu(\'"+Src_cell.msg_id+"\', \'"+Src_cell.collection_id+"\')", 500); } } // ------------------------------------------------------------------------------------------------- // Function for requesting of Vova's context menu // ------------------------------------------------------------------------------------------------- function OnMsgContextMenu() { window.event.cancelBubble = true; element = window.event.srcElement; while(element.tagName != 'TBODY') { element = element.parentElement; } // show context menu if object exist if (element.id) { var MessageObj = external.ObjByID(element.id); if (MessageObj != null) { if (MessageObj.IsSyncItemMsg()) { var Solution = MessageObj.GetM('m_SolutionWPtr'); if (Solution != null) { while (!element.sub_id) { element = element.parentElement; } external.ShowContextMenu(Solution, element.sub_id); } } else { external.ShowContextMenu(MessageObj, CONST_CID); } } } } // ------------------------------------------------------------------------------------------------- // alert('Cover/Show millde item for accosiation' ); // ------------------------------------------------------------------------------------------------- function OnPopupClick() { if(G_Above_message.mustshown == true) { G_Above_message.mustshown = false; CloseMenu(G_Above_message.msg_id, G_Above_message.collection_id); } else { G_Above_message.mustshown = true; OpenMenu(G_Above_message.msg_id, G_Above_message.collection_id); } } function OnPopupContextMenu() { // alert('OnPopupContextMenu()'); } function LeadUp(msg_id, CollectionID) { if((G_Above_message.msg_id != msg_id) || (G_Above_message.collection_id !=CollectionID)) { G_Above_message.mustshown = true; } } // ------------------------------------------------------------------------------------------ // alert("open menu - middle item for association"); // ------------------------------------------------------------------------------------------ function OpenMenu(msg_id, CollectionID) { if((G_Above_message.collection_id == CollectionID) && (G_Above_message.msg_id == msg_id) && (G_Above_message.mustshown == true) && (G_Shown_message.msg_id != msg_id)) { CloseMenu(G_Shown_message.msg_id, G_Shown_message.collection_id); // Get first element with specific ID var Collection_element = document.getElementById(CollectionID+'_container'); if (Collection_element == null) return; // Get the message by ID var Msg_element = Collection_element.all[msg_id]; //----------------------------------------------------------------------------------------- // New added for menu of deleted item if (Msg_element == null) return; //----------------------------------------------------------------------------------------- // Set the class for message Msg_element.className = Msg_element.className+" Exp"; // if item must be shown if(Msg_element.msg_type == '2') { var Base_up_element = Msg_element.all["Base_"+msg_id]; var Base_down_element = Base_up_element; } else { var Base_up_element = Msg_element.all["Base_up_"+msg_id]; var Base_down_element = Msg_element.all["Base_down_"+msg_id]; } // if it must to do nothing --------------------------------------------------------------------------------------------- if(Msg_element.if_dont_sync == 'true') var picture = "Pics/Radio_no_active.gif"; else var picture = "Pics/Radio_no_unactive.gif"; var MsgObj = external.ObjByID(msg_id); var solution = MsgObj.GetObjM('m_SolutionWPtr'); var Dont_sync_pic = '<img src="'+picture+'" onclick=OnArrowClick("'+ solution.objID+'","'+CONST_WIN_NO_SYNC+'") style="cursor:hand" title="'+external.LS('hint_Winner_Nothing')+'">'; // if it must to delete all --------------------------------------------------------------------------------------------- if(Msg_element.if_del_sync == 'true') var picture = "Pics/Radio_del_active.gif"; else var picture = "Pics/Radio_del_unactive.gif"; var MsgObj = external.ObjByID(msg_id); var solution = MsgObj.GetObjM('m_SolutionWPtr'); var Del_sync_pic = '<img src="'+picture+'" onclick=OnArrowClick("'+ solution.objID+'","'+CONST_WIN_DEL_SYNC+'") style="cursor:hand" title="'+external.LS('hint_Winner_Delete_All')+'">'; // ------------------------------------------------------------------------------------------------------------------------- var Up_plate = document.createElement("div"); var Down_plate = document.createElement("div"); Base_down_element.className = 'Back_plate1'; Base_up_element.appendChild(Up_plate); Base_down_element.appendChild(Down_plate); Up_plate.id = 'Up_plate'; Up_plate.className = "Up_plate_style_"+Msg_element.msg_type; Up_plate.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="MsgPopupCaption" width="100%" align="center">'+external.LS('popup_menu_select')+'</td></tr></table>'; Down_plate.id = 'Down_plate'; Down_plate.className = "Down_plate_style_"+Msg_element.msg_type; Down_plate.innerHTML = '<table width="100%" cellspacing="0" cellpadding="0">'+ '<tr>'+ '<td class="Down_plate_cell" style="padding-left:5px;">'+ '<span class="More_ref" onclick="OnUserMsgMoreButtonClick(\''+msg_id+'\', \''+CollectionID+'\')">'+ external.LS('popup_menu_more')+ '</span>'+ '</td>'+ '<td width="100%" class="Down_plate_cell">'+ '<img src="Pics/Dot.gif">'+ Dont_sync_pic+ '</td>'+ '<td class="Down_plate_cell" style="padding-right:7px;">'+ Del_sync_pic+'</td>'+ '</tr>'+ '</table>'; // ------------------------------------------------------------------------------------------------------------------------- G_Shown_message.msg_id = msg_id; G_Shown_message.collection_id = CollectionID; } } function CloseMenu(msg_id, CollectionID) { Aboveflag = (G_Above_message.collection_id == CollectionID)&&(G_Above_message.msg_id == msg_id); if((!Aboveflag || (G_Above_message.mustshown == false))&&(G_Shown_message.msg_id == msg_id) && (G_Shown_message.collection_id == CollectionID) && (G_Shown_message.msg_id != null)) { // find string in collection var Collection_element = document.getElementById(CollectionID+'_container'); if(Collection_element == null) { return; } // find message for(in) element var Msg_element = Collection_element.all[msg_id]; if(Msg_element == null) { return; } // change view to normal Msg_element.className = Msg_element.className.replace(/ Exp/,""); // find up_plate in message var Up_plate = Msg_element.all["Up_plate"]; if(Up_plate == null) return; else Up_plate.outerHTML = '';// Up_plate.removeNode(true); // find Down_plate in message var Down_plate = Msg_element.all["Down_plate"]; if(Down_plate == null) return; else Down_plate.outerHTML = '';// Down_plate.removeNode(true); // change to normal state if(Msg_element.msg_type == '2') Base_down_element = Msg_element.all["Base_"+msg_id]; else Base_down_element = Msg_element.all["Base_down_"+msg_id]; Base_down_element.className = 'Back_plate'; G_Shown_message.msg_id = null; // Debug_shown_msg.innerText = 'null'; G_Shown_message.collection_id = null; // Debug_shown_collection.innerText = 'null'; } } function AddTreeToAssoc() { var AssocObj = external.ObjByID(G_ActiveAssocID); AssocObj.Method0('M_CreateNewSyncTreeInAssoc'); // ExtOnAssocChanged(G_ActiveAssocID); ExtOnProfileChanged(); } function DeleteTreeFromAssoc(AssocID, SuperTreeID) { var AssocObj = external.ObjByID(AssocID); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SuperTree = SuperTreeList.ObjByID(SuperTreeID); SuperTreeList.Method1('M_RemoveKey', SuperTree); ExtOnProfileChanged(); } function OnUserMsgMoreButtonClick(MessageID, CollectionID) { window.event.cancelBubble = true; G_Above_message.latch = true; var MessageObj = external.ObjByID(MessageID); var Solution = MessageObj.GetM('m_SolutionWPtr'); external.ShowContextMenu(Solution, CollectionID); G_Above_message.latch = false; return; } function CapMenuLinkClick() { if(G_Caption_menu == false) { G_Caption_menu_mustshown = true; G_Caption_menu_above = true; Hint_window.style.visibility = 'hidden'; Change_link_container.style.visibility = 'hidden'; OpenCaptionMenu(); var Assoc_element = document.getElementById('Assoc_'+G_ActiveAssocID); Assoc_element.all['TopCapRadioLeft'].children[0].focus(); } } function CapMenuClick() { if(G_Caption_menu == false) { CapMenuLinkClick(); } else { G_Caption_menu_mustshown = false; CloseCaptionMenu(); } } function CapMenuFocusIn() { // Debug_window.innerHTML = 'CapMenuFocusIn(): '+window.event.srcElement.tagName+'<br>'+Debug_window.innerHTML; G_FocusInCaptionMenu = true; } function CapMenuFocusOut() { // Debug_window.innerHTML = 'CapMenuFocusOut(): '+window.event.srcElement.tagName+' to '+event.toElement.tagName+'<br>'+Debug_window.innerHTML; if(G_Block == false) { G_FocusInCaptionMenu = false; window.setTimeout("HandleCaptionMenu()", 10); } else { G_Block = false; } } function HandleCaptionMenu() { if(G_FocusInCaptionMenu == false) { // Debug_window.innerHTML = 'HandleCaptionMenu() before close<br>'+Debug_window.innerHTML; G_Caption_menu_mustshown = false; CloseCaptionMenu(); } } function CapMenuEnter() { G_Caption_menu_above = true; // G_Caption_menu_mustshown = true; window.setTimeout("OpenCaptionMenu()", 10); } function CapMenuLeave() { // Debug_window.innerHTML = 'CapMenuLeave()<br>'+Debug_window.innerHTML; G_Caption_menu_above = false; window.setTimeout("CloseCaptionMenu()", 10); } function OpenCaptionMenu() { // Debug_window.innerHTML = 'OpenCaptionMenu: G_Caption_menu_above = '+G_Caption_menu_above+'; G_Caption_menu = '+G_Caption_menu+' G_Caption_menu_mustshown = '+G_Caption_menu_mustshown+'<br>'+Debug_window.innerHTML; if((G_Caption_menu_above == true)&&(G_Caption_menu_mustshown == true)) { AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); SyncBoardsTable_element = AssocElement.all['SyncBoardsTable']; SyncBoardsTable_element.className = 'Exp'; if(G_Assocs[G_ActiveAssocID].WinningSuperTreeID == CONST_CID) { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way.gif'; } else { Caption_down_plate.all['AllWayRadio'].src = 'Pics/Radio_all_way_unactive.gif'; } var AssocObj = external.ObjByID(G_ActiveAssocID); If_remove_check.checked = AssocObj.Method0('M_GetMimicDeleted'); If_rewrite_check.checked = AssocObj.Method0('M_GetMimicChanged'); Caption_up_plate.style.visibility = 'visible'; Caption_down_plate.style.visibility = 'visible'; G_Caption_menu = true; } } function CloseCaptionMenu() { if((G_Caption_menu_above == false)||((G_Caption_menu == true)&&(G_Caption_menu_mustshown == false))) { AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); SyncBoardsTable_element = AssocElement.all['SyncBoardsTable']; //---------------------------------------------------------------------------------------------------------------- var state = 'Normal_State'; var AssocObj = external.ObjByID(G_ActiveAssocID); if ((1 == AssocObj.Method1('M_GetStatusAttribute', STATUS_ATTRIBUTE_ANALYZING)) && (0 == AssocObj.Method1('M_GetStatusAttribute', STATUS_ATTRIBUTE_INFORMATION_MESSAGE)) && (0 == AssocObj.Method1('M_GetStatusAttribute', STATUS_ATTRIBUTE_IMPORTANT_MESSAGE))) state = 'Analyze_State'; else if (1 == AssocObj.Method1('M_GetStatusAttribute', STATUS_ATTRIBUTE_SYNCHRONIZING )) state = 'Sync_State'; SyncBoardsTable_element.className = state; //---------------------------------------------------------------------------------------------------------------- Change_link_container.style.visibility = 'visible'; Caption_up_plate.style.visibility = 'hidden'; Caption_down_plate.style.visibility = 'hidden'; G_Caption_menu = false; G_Caption_menu_mustshown = false; } } function ResizeWindow() { var AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); if(AssocElement == null) { return; } if(Hint_window.hint_number != '') { var element = AssocElement.all["TreePath"+Hint_window.hint_number]; PlaceHintWindow(element, Hint_window.hint_number); } var _left = 285; var element1 = AssocElement.all["SyncBoardsTable"]; var _width = element1.offsetWidth - 590; var _top_h = element1.offsetHeight; var _top = 0; while(element1.tagName!= 'BODY') { _left += element1.offsetLeft; _top += element1.offsetTop; element1 = element1.offsetParent; } //if(document.SyncBoardsTable != null)// New { var _center = (_width/2)+_left; Change_link_container.style.left = _left+30; Change_link_container.style.width = _width-40; Change_link_container.style.top = _top+17; //Caption_up_plate.style.left = _left+1; //Caption_up_plate.style.width = _width-2; Caption_up_plate.style.left = _center-105; Caption_up_plate.style.width = 230; var _top_up = Caption_up_plate.offsetHeight; Caption_up_plate.style.top = _top-_top_up; //Caption_down_plate.style.left = _left; //Caption_down_plate.style.width = _width; Caption_down_plate.style.left = _center-106; Caption_down_plate.style.width = 232; Caption_down_plate.style.top = _top+_top_h; } } function ManualOn() { AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); AssocElement.all['Manual_switch'].className = 'Switch_control_active'; AssocElement.all['Auto_switch'].className = 'Switch_control_unactive'; AssocElement.all['Control_buttons_panel'].innerHTML = Manual_template.innerHTML; //--------------------- AssocElement.all['B_ANALYZE'].innerText = external.LS("button_analyze"); AssocElement.all['B_ANALYZE'].title = external.LS("tooltip_Analyze_button"); AssocElement.all['B_ANALYZE'].association_id = AssocID; AssocElement.all['B_SYNC'].innerText = external.LS("button_synchronize"); AssocElement.all['B_SYNC'].title = external.LS("tooltip_Sinchronize_button"); AssocElement.all['B_SYNC'].association_id = AssocID; AssocElement.all['B_STOP'].innerText = external.LS("button_stop"); AssocElement.all['B_STOP'].title = external.LS("tooltip_Stop_button"); AssocElement.all['B_STOP'].association_id = AssocID; AssocElement.all['Important_warning_text'].innerText = external.LS("important_warning"); AssocElement.all['Important_warning'].title = external.LS("tooltip_Important_warning"); UpdateButtons(G_ActiveAssocID); } function AutoOn() { AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); AssocElement.all['Manual_switch'].className = 'Switch_control_unactive'; AssocElement.all['Auto_switch'].className = 'Switch_control_active'; AssocElement.all['Control_buttons_panel'].innerHTML = Auto_template.innerHTML; } function CapRadioHandler(AssocID, SuperTreeID) //For DU: Used if one way sync turn on { window.event.cancelBubble = true; G_Assocs[AssocID].WinningSuperTreeID = SuperTreeID; var AssocObj = external.ObjByID(AssocID); G_AssocChangedCause = 'SyncDirectionChanged'; AssocObj.Method1ID('M_SetSyncDirection', SuperTreeID); //For DU: set one way sync G_AssocChangedCause = ''; } function CapAllWayOn() //For DU: Used if one way sync turn off { window.event.cancelBubble = true; G_Assocs[G_ActiveAssocID].WinningSuperTreeID = CONST_CID; var AssocObj = external.ObjByID(G_ActiveAssocID); G_AssocChangedCause = 'SyncDirectionChanged'; AssocObj.Method1ID('M_SetSyncDirection', 'DIRECTION_ALL_WAY'); //For DU: set all way sync G_AssocChangedCause = ''; //DU: we'll get an event about paths has changed. LoadAssocPaths(G_ActiveAssocID); } function CaptionCheckBoxClick(element) { // Debug_window.innerHTML = 'CaptionCheckBoxClick()<br>'+Debug_window.innerHTML; window.event.cancelBubble = true; var AssocObj = external.ObjByID(G_ActiveAssocID); if(element.id == "If_remove_check") { G_AssocChangedCause = 'Propagate_set'; AssocObj.Method1('M_SetMimicDeleted', element.checked); G_AssocChangedCause = ''; } else if(element.id == "If_rewrite_check") { G_AssocChangedCause = 'Propagate_set'; AssocObj.Method1('M_SetMimicChanged', element.checked); G_AssocChangedCause = ''; } } function CaptionLabelClick(element) { // Debug_window.innerHTML = 'CaptionLabelClick()<br>'+Debug_window.innerHTML; window.event.cancelBubble = true; } function BlockFocusOut() { G_Block = true; // Debug_window.innerHTML = 'BlockFocusOut()<br>'+Debug_window.innerHTML; } function ButtonContextMenu() { window.event.cancelBubble = true; } function StopContextMenu() { window.event.cancelBubble = true; } function Debug() { // G_Block = true; // Debug_window.innerHTML = 'Debug()<br>'+Debug_window.innerHTML; // AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); // external.StrToDebugFile(AssocElement.outerHTML); } function OnMouseOverPath() { event.srcElement.className = "VisitedItem"; } function OnMouseOutPath() { event.srcElement.className = ""; } //---------------------------------------------------------------------------------------------------------------------- // this.build_root=function() // this.build_collection=function(CollectionID) // this.build_message=function(CollectionID, MsgID, MsgEvenness) // this.redraw=function() // function redraws whole treeview // this.redraw_collection=function(CollectionID) //---------------------------------------------------------------------------------------------------------------------- function CreateTree(AssocID, name, spanid) // main TreeView object { //-------------------------------------------------------------------------------------------------------------------- this._name = name; // name of object : "tree" this._spanid = spanid; // id of existing div used for treeview : "TreeView_element" link to code of container this._associationID = AssocID; // link to association this._collections = {}; // new Array(); that will contain collections this._collectionIdByName = {}; // new Array(); that will contain names of collections this._image_collapsed="Pics/collapsed.gif"; // image for parent nodes when they are collapsed this._image_expanded="Pics/expanded.gif"; // image for parent nodes when they are expanded this.root = // main node properties { _id:name+"_root", // name _childrencount:0, // quantity of children _children:[] // children array }; //------------------------------------------------------------------------------------------------------------------ // (R) this.build_root=function() // { var html_code = '<div id="'+this.root._id+'" >\n'; html_code += '<table width="100%" cellpadding="0" cellspacing="0" border="0">'; for(i in this.root._children) html_code += '<tr><td>'+this.build_collection(i)+'</td></tr>'; html_code += '</table></div>'; return html_code; }; // (R) build interface collection from core collection this.build_collection=function(CollectionID) { //----------------------------------------------------------------------------------------- var collection = this.root._children[CollectionID]; var msgs = this._collections[CollectionID].obj; var CollectionChildrenCount = msgs.Method0('M_GetCount'); //----------------------------------------------------------------------------------------- var Important_sign = ''; var sub_collection_html = ''; var collection_html = ''; //----------------------------------------------------------------------------------------- var MsgScrollersExist = false; var Prev_html = ''; var Next_html = ''; var Prev_exist = false; var Next_exist = false; var i = 0; var msg = null; //----------------------------------------------------------------------------------------- if(this._collections[CollectionID].name == 'Important') { var AssocElement = document.getElementById('Assoc_'+this._associationID); AssocElement.all['Important_warning'].style.visibility = "hidden"; if(CollectionChildrenCount > 0) { AssocElement.all['Important_warning'].style.visibility = "inherit"; Important_sign = '<span><img src="Pics/warning_small.gif"></span> '; } } //----------------------------------------------------------------------------------------- collection_html+='<div id="'+CollectionID+'" class="Collection_class" onmousewheel="return scrollIt(\''+CollectionID+'\');">'; if (CollectionChildrenCount == 0) { collection._empty = true; } else //if (CollectionChildrenCount > 0) { collection._empty = false; if(collection._expanded == 1) { if (CollectionChildrenCount > external.Method1('M_GetGlobalOption', 'ItemsPerPage')) MsgScrollersExist = true; //---------------------------------------------------------------------------------------- msg = msgs.GetFirst(); var firstVisibleMsgID = (msgs.Method0('M_GetFirstVisibleMessage')).objID; if (firstVisibleMsgID != msg.objID) {Prev_exist = true; } else {Prev_exist = false;} Prev_html = new CreateScrollControls("prev", Prev_exist, CollectionID, MsgScrollersExist); //---------------------------------------------------------------------------------------- var MsgEvenness = 1 - collection._first_disp_msg_evenness; msg = msgs.Method0('M_GetFirstVisibleMessage'); if (msg != null) var lastVisibleMsgID = msg.objID; while (msg != null) { MsgEvenness = 1 - MsgEvenness; sub_collection_html += this.build_message(CollectionID, msg.objID, MsgEvenness); msg = msgs.Method1('M_GetNextVisibleMessage', msg); if (msg != null) lastVisibleMsgID = msg.objID; } //---------------------------------------------------------------------------------------- msg = msgs.GetLast(); if (lastVisibleMsgID != msg.objID) {Next_exist = true; } else {Next_exist = false;} Next_html = new CreateScrollControls("next", Next_exist, CollectionID, MsgScrollersExist); //---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------- //--------- Collection header area begin --------------------------------------- //------------------------------------------------------------------------------ collection_html+='\n' + '<div id="'+CollectionID+'_in" style="width:100%; position:relative; left:0;">'+ '\n'+ '<table class="ParentNode" border="0" cellpadding="0" cellspacing="0">'+ '<tr>'+ '<td valign=middle align=center oncontextmenu="StopContextMenu()">'+ '<div style="width:30px;"><img onclick="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" src="'+ this._image_expanded+'">'+ '</div>'+ '</td>'+ '<td oncontextmenu="StopContextMenu()" nowrap>'+ '<span tabindex="4" onkeypress="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" '+ 'class="CollectionName" onclick="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" '+ 'style="cursor:hand;" title="'+external.LS('tooltip_'+this._collections[CollectionID].name+'_collection')+'">'+ Important_sign+collection._caption+' (<span id="'+ CollectionID+'_caption">'+CollectionChildrenCount+'</span>) '+ '</span>'; collection_html+= '</td>'+ '<td width="100%" align="left">'+ '</td>'+ '<td id="TopPrev_end" valign="bottom" >'+Prev_html.top_end+'</td>'+ '<td id="TopPrev_page" valign="bottom" >'+Prev_html.top_page+'</td>'+ '<td id="TopPrev_msg" valign="bottom" >'+Prev_html.top_msg+'</td>'+ '<td id="TopNext_msg" valign="bottom" >'+Next_html.top_msg+'</td>'+ '<td id="TopNext_page" valign="bottom" >'+Next_html.top_page+'</td>'+ '<td id="TopNext_end" valign="bottom" >'+Next_html.top_end+'</td>'+ '</tr>'+ '</table>'+ '</div>'+ '\n'; //------------------------------------------------------------------------------ //--------- Collection header area end ----------------------------------------- //------------------------------------------------------------------------------ //---------------------------------------------------------------------------------------------------------------------------------------------------- // Collection area begin ----------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------------------------------- collection_html += '<div style="position: relative;"> '+ //---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------------------------------- '<table class="MessageList" border="0" cellspacing="0" cellpadding="0">'+ '<tr>'+ '<td class="MsgCollectionScrollBar" style="width:16px; height:100%;">'+ //----------------------------------------------------------------- '<table height="100%" style="background:#88BAC8;" width="16px" border="0" cellpadding="0" cellspacing="0" id="'+CollectionID+'_ScrollBar">'+ '<tr><td height="15px" style="border: solid 1px #787864; border-right: none; border-bottom: none; background:#88BAC8;">'+'<img src="Pics/Dot.gif">'+'</td></tr>'+ '<tr><td id="Prev_end" style="padding-top: 1px; border-left: solid 1px #787864;">' + Prev_html.end+'</td></tr>'+ '<tr><td id="Prev_page" style="padding-top: 1px; border-left: solid 1px #787864;">' + Prev_html.page+'</td></tr>'+ '<tr><td id="Prev_msg" style="padding-top: 1px; border-left: solid 1px #787864;">' + Prev_html.msg+'</td></tr>'; collection_html += '<tr><td id="Scroll_all" style="padding-top: 1px; border-left: solid 1px #787864;">' + Prev_html.scroll + '</td></tr>'; collection_html += '<tr><td id="Next_msg" style="padding-top: 1px; border-left: solid 1px #787864;">' + Next_html.msg+'</td></tr>'+ '<tr><td id="Next_page" style="padding-top: 1px; border-left: solid 1px #787864;">' + Next_html.page+'</td></tr>'+ '<tr><td id="Next_end" style="padding-top: 1px; border-left: solid 1px #787864;">' + Next_html.end+'</td></tr>'+ '<tr height="100%"><td height="100%" style="border: solid 1px #787864; border-top: none; border-right: none; background:#88BAC8;">'+'<img src="Pics/Dot.gif">'+'</td></tr>'+ '</table>'+ //---------------------------------------------------------------- '</td>'; collection_html += '<td width="100%">'; //-------------------------------------------------------------------------------------------- if(this._collections[CollectionID].name != 'Important') // Begin not for Important collection speed is fine { //---------------------------------------------------------------------------------------------------------------------------------------------------- var New_Sort_Info = 'Sort_by_default'; //---------------------------------------------------- var msgs = external.ObjByID(CollectionID); var Last_Sort_ID = msgs.Method0('M_GetSortingCriterion'); var TreeID = msgs.Method0('M_GetSortingTree'); //---------------------------------------------------- var AssocObj = external.ObjByID(G_ActiveAssocID); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SuperTree_Obj = SuperTreeList.GetFirst(); var Tree_0_ID = SuperTree_Obj.objID; SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); var Tree_1_ID = SuperTree_Obj.objID; //----------------------------------------------------------------------------------------------- if ((Last_Sort_ID == '646E6563736544435174726F53676E69') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_name_down_1';} else if ((Last_Sort_ID == '69646E6563734143464974726F53676E') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_name_up_1';} else if ((Last_Sort_ID == '646E6563736544436B74726F53676E69') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_size_down_1';} else if ((Last_Sort_ID == '69646E6563734143604974726F53676E') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_size_up_1';} else if ((Last_Sort_ID == '646E6563736544435F74726F53676E69') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_time_down_1';} else if ((Last_Sort_ID == '69646E6563734143544974726F53676E') && (TreeID == Tree_0_ID)) {New_Sort_Info = 'Sort_by_time_up_1';} //----------------------------------------------------------------------------------------------- else if ((Last_Sort_ID == '646E6563736544435174726F53676E69') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_name_down_2';} else if ((Last_Sort_ID == '69646E6563734143464974726F53676E') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_name_up_2';} else if ((Last_Sort_ID == '646E6563736544436B74726F53676E69') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_size_down_2';} else if ((Last_Sort_ID == '69646E6563734143604974726F53676E') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_size_up_2';} else if ((Last_Sort_ID == '646E6563736544435F74726F53676E69') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_time_down_2';} else if ((Last_Sort_ID == '69646E6563734143544974726F53676E') && (TreeID == Tree_1_ID)) {New_Sort_Info = 'Sort_by_time_up_2';} //----------------------------------------------------------------------------------------------- else if ((Last_Sort_ID == '646E6563736544434374726F53676E69')) {New_Sort_Info = 'Sort_by_winner_down';} else if ((Last_Sort_ID == '69646E6563734143744974726F53676E')) {New_Sort_Info = 'Sort_by_winner_up';} //----------------------- var NameItem1 = external.LS("sort_name_item"); var NameItem2 = external.LS("sort_name_item"); //----------------------- var SizeItem1 = '<span style="width:40px;"> ' + external.LS("sort_size_item") + '</span>'; var SizeItem2 = '<span style="width:40px;"> ' + external.LS("sort_size_item") + '</span>'; //----------------------- var TimeItem1 = '<span style="width:90px"> ' + external.LS("sort_time_item") + '</span>'; var TimeItem2 = '<span style="width:90px"> ' + external.LS("sort_time_item") + '</span>'; //----------------------- var WinnerItem = '<span style="width:98px"> ' + external.LS("sort_winner_item") + '</span>'; //----------------------- if (New_Sort_Info == 'Sort_by_name_up_1' ) NameItem1 = '<img src="Pics/Sort_Up.gif"> ' + external.LS("sort_name_item"); else if (New_Sort_Info == 'Sort_by_name_up_2' ) NameItem2 = '<img src="Pics/Sort_Up.gif"> ' + external.LS("sort_name_item"); else if (New_Sort_Info == 'Sort_by_name_down_1') NameItem1 = '<img src="Pics/Sort_Down.gif"> ' + external.LS("sort_name_item"); else if (New_Sort_Info == 'Sort_by_name_down_2') NameItem2 = '<img src="Pics/Sort_Down.gif"> ' + external.LS("sort_name_item"); //----------------------- else if (New_Sort_Info == 'Sort_by_size_up_1' ) SizeItem1 = '<span style="width:40px;"> <img src="Pics/Sort_Up.gif"> ' + external.LS("sort_size_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_size_up_2' ) SizeItem2 = '<span style="width:40px;"> <img src="Pics/Sort_Up.gif"> ' + external.LS("sort_size_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_size_down_1') SizeItem1 = '<span style="width:40px;"> <img src="Pics/Sort_Down.gif"> ' + external.LS("sort_size_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_size_down_2') SizeItem2 = '<span style="width:40px;"> <img src="Pics/Sort_Down.gif"> ' + external.LS("sort_size_item") + '</span>'; //----------------------- else if (New_Sort_Info == 'Sort_by_time_up_1' ) TimeItem1 = '<span style="width:90px"> <img src="Pics/Sort_Up.gif"> ' + external.LS("sort_time_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_time_up_2' ) TimeItem2 = '<span style="width:90px"> <img src="Pics/Sort_Up.gif"> ' + external.LS("sort_time_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_time_down_1') TimeItem1 = '<span style="width:90px"> <img src="Pics/Sort_Down.gif"> ' + external.LS("sort_time_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_time_down_2') TimeItem2 = '<span style="width:90px"> <img src="Pics/Sort_Down.gif"> ' + external.LS("sort_time_item") + '</span>'; //----------------------- else if (New_Sort_Info == 'Sort_by_winner_up' ) WinnerItem = '<span style="width:98px"> <img src="Pics/Sort_Up.gif"> ' + external.LS("sort_winner_item") + '</span>'; else if (New_Sort_Info == 'Sort_by_winner_down') WinnerItem = '<span style="width:98px"> <img src="Pics/Sort_Down.gif"> ' + external.LS("sort_winner_item") + '</span>'; //----------------------- collection_html += '<table id="'+CollectionID+'_sort_container" width="100%" border="0" cellspacing="0" cellpadding="0" class="Collection_Table" style="border-left: none;">'+ '<tr class="Single_row">'+ '<td id="'+CollectionID+'_sort_by_name_1" class="SyncAttrNameHead" onclick="OnSortItemClick(\'name_1\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_name') + '" width="50%" style="background:#88BAC8; cursor:hand; "> ' + NameItem1 + '</td>'+ '<td id="'+CollectionID+'_sort_by_size_1" class="SyncAttrSizeHead" onclick="OnSortItemClick(\'size_1\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_size') + '" style="background:#88BAC8; cursor:hand;"> ' + SizeItem1 + '</td>'+ '<td id="'+CollectionID+'_sort_by_time_1" class="SyncAttributeHead" onclick="OnSortItemClick(\'time_1\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_time') + '" nowrap style="background:#88BAC8; cursor:hand;"> ' + TimeItem1 + '</td>'+ '<td id="'+CollectionID+'_sort_by_winner" class="SyncWinnerItemHead" onclick="OnSortItemClick(\'winner\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_winner')+ '" style="background:#88BAC8; cursor:hand;"> ' + WinnerItem + '</td>'+ '<td id="'+CollectionID+'_sort_by_name_2" class="SyncAttrNameHead" onclick="OnSortItemClick(\'name_2\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_name') + '" width="50%" style="background:#88BAC8; cursor:hand;"> ' + NameItem2 + '</td>'+ '<td id="'+CollectionID+'_sort_by_size_2" class="SyncAttrSizeHead" onclick="OnSortItemClick(\'size_2\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_size') + '" style="background:#88BAC8; cursor:hand;"> ' + SizeItem2 + '</td>'+ '<td id="'+CollectionID+'_sort_by_time_2" class="SyncAttributeHead" onclick="OnSortItemClick(\'time_2\',\''+CollectionID+'\');" title="'+external.LS('tooltip_sort_by_time') + '" nowrap style="background:#88BAC8; cursor:hand;"> ' + TimeItem2 + '</td>'+ '</tr>'+ '</table>'; //------------------------------------------------------------------------------------------------------------------------------------------------------- } // End not for Important collection //------------------------------------------------------------------------------------------------------------------------------------------------------- collection_html += '<table id="'+CollectionID+'_container" sub_id="'+CollectionID+'" '+ 'width="100%" border="0" cellspacing="0" cellpadding="0" class="Collection_Table">'+ sub_collection_html+ '</table>'+ '</td></tr></table></div>'; } else //if(collection._expanded == 0) { collection_html+='\n<div id="'+CollectionID+'_in" style="width:100%; position:relative; left:0;">\n'+ '<table class="ParentNode" border="0" cellpadding="0" cellspacing="0"><tr><td valign=middle align=center oncontextmenu="StopContextMenu()">'+ '<div style="width:30px;"><img onclick="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" src="'+this._image_collapsed+'"></div></td><td oncontextmenu="StopContextMenu()" nowrap>'+ '<span tabindex="4" onkeypress="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" class="CollectionName" onclick="OnCollectionExpandIconClick(\''+this._associationID+'\',\''+CollectionID+'\');" style="cursor:hand;" title="'+external.LS('tooltip_'+this._collections[CollectionID].name+'_collection')+'">'+Important_sign+collection._caption+' (<span id="'+ CollectionID+'_caption">'+CollectionChildrenCount+'</span>)</span> '; collection_html+='</td><td width="100%"></td></tr></table></div>\n'; } } collection_html += '</div>\n\n'; return collection_html; }; //----------------------------------------------------------------------------------------- // (R) this.build_message=function(CollectionID, MsgID, MsgEvenness) { var msg = external.ObjByID(MsgID); message_html = FillMsgNode(msg, MsgEvenness, CollectionID); return message_html; }; // (R) this.redraw=function() // function redraws whole treeview { var AssocElement = document.getElementById('Assoc_'+this._associationID); var ele = AssocElement.all[this._spanid]; ele.innerHTML = this.build_root(); }; // (R) this.redraw_collection=function(CollectionID) { var AssocElement = document.getElementById('Assoc_'+this._associationID); var collection_element = AssocElement.all[CollectionID]; if (collection_element != null) { collection_element.outerHTML = this.build_collection(CollectionID); } }; // (R) this.add_collection_node=function(msgs, collectionName, caption) // adds node { //if ((collectionName != 'Important') && (collectionName != 'All')) return; var CollectionID = msgs.objID; this._collections[CollectionID] = {}; this._collections[CollectionID].obj = msgs; this._collections[CollectionID].name = collectionName; if (this._collections[CollectionID].sort == null) {this._collections[CollectionID].sort = 'sort_by_default';} this._collectionIdByName[collectionName] = CollectionID; var collection_node={}; collection_node._caption=caption; // get collection state from core var expanded = this._collections[CollectionID].obj.Method0('M_GetCollectionState'); collection_node._expanded=expanded; if(expanded == 1) var NotifyFlag = true; else var NotifyFlag = false; if(msgs == null) { alert('add_collection_node: CollectionObj (msgs) == null'); collection_node._empty = true; } else { var first_message = msgs.GetFirst(); if(first_message == null) { collection_node._empty = true; } else { collection_node._first_disp_msg_evenness = 1; collection_node._empty = false; } } this.root._childrencount++; this.root._children[CollectionID]=collection_node; return collection_node; }; /////////////////////////////////////////////////////////////////////////////////////////////////// this.add_message_node=function(CollectionID,MsgID,InsertPosition) // adds node { if(this._collections[CollectionID] == null) return; var collection = this.root._children[CollectionID]; var msgs = this._collections[CollectionID].obj; if(msgs == null) alert('msgs == null'); //-------------------------------------------------------------------------------------------- if(collection._empty == true) { collection._empty = false; collection._first_disp_msg_evenness = 1; G_Assocs[AssocID].TreeView.redraw_collection(CollectionID); return; } //--------------------------------------------------------------------------------------------- if(collection._expanded == 1) { var collection_container_element = document.getElementById('Assoc_'+this._associationID).all[CollectionID+'_container']; if (collection_container_element.children) var msg_page_length = collection_container_element.children.length; else return; if (msg_page_length<CONST_MESSAGES_ON_PAGE) { //------------------------------------------------------------------------------------- var new_message_element = document.createElement('tbody'); if(InsertPosition == -1) { collection_container_element.appendChild(new_message_element); BuildMessageAsObject(new_message_element, CollectionID, MsgID, (collection._first_disp_msg_evenness+msg_page_length)%2); } else { collection_container_element.insertBefore(new_message_element, collection_container_element.children(InsertPosition)); var MsgEvenness = (collection._first_disp_msg_evenness+InsertPosition)%2; BuildMessageAsObject(new_message_element, CollectionID, MsgID, MsgEvenness); var i; for(i=InsertPosition + 1; i<=msg_page_length; i++) { if (MsgEvenness == 0) {collection_container_element.children(i).className = "Msg_Odd"; MsgEvenness = 1;} else {collection_container_element.children(i).className = "Msg_Even"; MsgEvenness = 0;} } } } //--------------------------------------------------------------------------------------- else // if (msg_page_length >=CONST_MESSAGES_ON_PAGE) { var new_message_element = document.createElement('tbody'); collection_container_element.removeChild(collection_container_element.children(CONST_MESSAGES_ON_PAGE-1)); if(InsertPosition == -1) { collection_container_element.appendChild(new_message_element); BuildMessageAsObject(new_message_element, CollectionID, MsgID, (collection._first_disp_msg_evenness+msg_page_length)%2); } else { collection_container_element.insertBefore(new_message_element, collection_container_element.children(InsertPosition)); var MsgEvenness = (collection._first_disp_msg_evenness+InsertPosition)%2; BuildMessageAsObject(new_message_element, CollectionID, MsgID, MsgEvenness); var i; for(i=InsertPosition + 1; i<CONST_MESSAGES_ON_PAGE ;i++) { if (MsgEvenness == 0) {collection_container_element.children(i).className = "Msg_Odd"; MsgEvenness = 1;} else {collection_container_element.children(i).className = "Msg_Even"; MsgEvenness = 0;} } } } //--------if (msg_page_length >=CONST_MESSAGES_ON_PAGE) end------------------------------ } }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// this.click=function(CollectionID) // expands or collaps node { this.root._children[CollectionID]._expanded = 1-this.root._children[CollectionID]._expanded; this._collections[CollectionID].obj.Method1('M_SetCollectionState',this.root._children[CollectionID]._expanded); this.redraw_collection(CollectionID); }; return this; }; // CreateTree() end function ExtChangeBannerState(State) { var El = document.getElementById('Banner_place'); if (State == 1) { El.style.display = ''; //Banner_on_off.title=external.LS('hint_Banner_on'); } else { El.style.display = 'none'; //Banner_on_off.title=external.LS('hint_Banner_off'); } ResizeWindow(); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function ExtLinkToCollectionMsg(CollectionName, MsgObjID) { LinkToCollectionMsg(CollectionName, MsgObjID); } function LinkToCollectionMsg(CollectionName, MsgObjID) { var AssocContainer = document.getElementById('Assoc_'+G_ActiveAssocID); var CollectionId = G_Assocs[G_ActiveAssocID].TreeView._collectionIdByName[CollectionName]; //-------------------------------------------------------------------------------- if(G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionId]._expanded == 0) { OnCollectionExpandIconClick(G_ActiveAssocID, CollectionId); } //-------------------------------------------------------------------------------- var LinkID = 'Link'+CollectionId+MsgObjID; var LinkItem = document.getElementById(LinkID); if(LinkItem == null) { var CollectionObj = external.ObjById(CollectionId); var msg = CollectionObj.Method1('M_GetItemBySolutionID',MsgObjID); if (msg == null) return; var solution = msg.GetObjM('m_SolutionWPtr'); if (solution.objID == MsgObjID) { var counter = 0; var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionId].obj; var FirstMsg = msgs.GetFirst(); var msg2 = msgs.GetLast(); var solution2 = msg2.GetObjM('m_SolutionWPtr'); while((solution2.objID != MsgObjID) && (counter < CONST_MESSAGES_ON_PAGE)) { msg2 = msgs.GetPrev(msg2); solution2 = msg2.GetObjM('m_SolutionWPtr'); counter = counter + 1; } if (counter == CONST_MESSAGES_ON_PAGE) { CollectionObj.Method1('M_SetFirstVisibleMessageByIndex', CollectionObj.Method1('M_GetMessageIndexByID', msg.objID)); } else { for (i = CONST_MESSAGES_ON_PAGE; i > counter + 1; i--) { msg2 = msgs.GetPrev(msg2); solution2 = msg2.GetObjM('m_SolutionWPtr'); } CollectionObj.Method1('M_SetFirstVisibleMessageByIndex', CollectionObj.Method1('M_GetMessageIndexByID', msg2.objID)); } G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionId); LinkItem = document.getElementById(LinkID); if (LinkItem != null) LinkItem.scrollIntoView(true); } else if (msg.objID == msgs.GetLast().objID) { alert('LinkItem is not found'); } } else { LinkItem.scrollIntoView(true); } } //------------------------------------------------------------ // progress Bar block //------------------------------------------------------------ function ExtUpdateProgressBar(AssocID, State, Percents) { var processName = "undefined"; var stateString = "undefined"; var titleString = ""; if ((State == null) || (State == 0) || (State == 2)) { document.getElementById("sliderWrapper").style.visibility = "hidden"; document.getElementById("sliderWrapper").firstChild.nodeValue = 0 + "%"; document.getElementById("slider").firstChild.nodeValue = 0 + "%"; if (State == 0) { var AssocObj = external.ObjByID(AssocID); var Status = AssocObj.Method0('M_GetAggregatedGeneralStatus'); if (Status == STATUS_ATTRIBUTE_AUTOMATIC || Status == STATUS_ATTRIBUTE_AUTOMATIC_INTERNAL) { stateString = external.LS("Auto_Sync_Is_On"); titleString = external.LS("tooltip_Auto_Sync_Is"); } else { stateString = external.LS("Auto_Sync_Is_Off"); titleString = external.LS("tooltip_Auto_Sync_Is"); } } else if (State == 2) { stateString = external.LS("Pr_Bar_A_Is_Done"); titleString = ""; } } else { //------------------------------------------------------------------------------------- if (State == 1) processName = external.LS("Pr_Bar_Analyzing"); else if (State == 3) processName = external.LS("Pr_Bar_Synchronizing"); //------------------------------------------------------------------------------------- var factor = Percents/100; var pct = Math.ceil(factor*100); document.getElementById("sliderWrapper").firstChild.nodeValue = processName + pct + "%"; document.getElementById("slider").firstChild.nodeValue = processName + pct + "%"; document.getElementById("slider").style.clip = "rect(0px " + parseInt(factor*387) + "px 16px 0px)"; document.getElementById("sliderWrapper").style.visibility = "visible"; } document.getElementById("progressBarMsg").innerHTML = stateString; document.getElementById("progressBarMsg").title = titleString; return; } //-------------------------------------------------------------------------------------------- //correctPNG block //-------------------------------------------------------------------------------------------- function correctPNG() { for(var i=0; i<document.images.length; i++) { var img = document.images[i] var imgName = img.src.toUpperCase() if (imgName.substring(imgName.length-3, imgName.length) == "PNG") { var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText var imgAttribs = img.attributes; var onMouseOver = "", onMouseOut = ""; for (var j=0; j<imgAttribs.length; j++) { var imgAttrib = imgAttribs[j]; if (imgAttrib.nodeName == "align") { if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle break } } if (img.name && !img.id) imgID= "id='" + img.name + "' " if ((pos=img.outerHTML.toUpperCase().indexOf("ONMOUSEOVER="))>0) { onMouseOver=img.outerHTML.substring(pos); pos=onMouseOver.indexOf(");"); if (onMouseOver.substr(12,1)== "\"") pos=onMouseOver.indexOf(");\""); onMouseOver=" " + onMouseOver.substring(0,pos+2).replace("MM_swap","MM_PNGswap") + ((onMouseOver.substr(12,1)== "\"") ? "\"":"") + " "; } pos=0 if ((pos=img.outerHTML.toUpperCase().indexOf("ONMOUSEOUT="))>0) { onMouseOut=img.outerHTML.substring(pos); pos=onMouseOut.indexOf(");"); if (onMouseOut.substr(11,1)== "\"") pos=onMouseOut.indexOf(");\""); onMouseOut=" " + onMouseOut.substring(0,pos+2).replace("MM_swap","MM_PNGswap") + ((onMouseOut.substr(11,1)== "\"") ? "\"":"") + " "; } pos=0 var strNewHTML = "<span " + imgID + imgClass + imgTitle strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\""; strNewHTML += onMouseOver + onMouseOut + "></span>" img.outerHTML = strNewHTML i = i-1 } } for(var i=0; i<document.links.length; i++) { var lnk = document.links[i]; var tStr=""; if ((pos=lnk.outerHTML.indexOf("MM_swapImage("))>0) { tStr=lnk.outerHTML.substring(pos+13); pos=tStr.indexOf(");"); if (pos>0) { pos=tStr.substring(0,pos).toUpperCase().indexOf(".PNG"); if (pos>0) lnk.outerHTML = lnk.outerHTML.replace(/MM_swap/g,"MM_PNGswap"); } } } } function MM_PNGswapImage() { //v3.0 var i,j=0,x,a=MM_PNGswapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){ document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.filters(0).src; x.filters(0).src=a[i+2]; } } function MM_PNGswapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.filters(0).src=x.oSrc; } window.attachEvent("onload", correctPNG); //-------------------------------------------------------------------------------------------- //end of correctPNG block //-------------------------------------------------------------------------------------------- function OnSortItemClick(Sort_Type, CollectionID) { var Last_Sort_Info = 'Sort_by_default'; var New_Sort_Info = 'Sort_by_default'; //---------------------------------------------------- var msgs = external.ObjByID(CollectionID); var Last_Sort_ID = msgs.Method0('M_GetSortingCriterion'); var TreeID = msgs.Method0('M_GetSortingTree'); //---------------------------------------------------- var AssocObj = external.ObjByID(G_ActiveAssocID); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SuperTree_Obj = SuperTreeList.GetFirst(); var Tree_0_ID = SuperTree_Obj.objID; SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); var Tree_1_ID = SuperTree_Obj.objID; //----------------------------------------------------------------------------------------------- if ((Last_Sort_ID == '646E6563736544435174726F53676E69') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_name_down_1';} else if ((Last_Sort_ID == '69646E6563734143464974726F53676E') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_name_up_1';} else if ((Last_Sort_ID == '646E6563736544436B74726F53676E69') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_size_down_1';} else if ((Last_Sort_ID == '69646E6563734143604974726F53676E') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_size_up_1';} else if ((Last_Sort_ID == '646E6563736544435F74726F53676E69') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_time_down_1';} else if ((Last_Sort_ID == '69646E6563734143544974726F53676E') && (TreeID == Tree_0_ID)) {Last_Sort_Info = 'Sort_by_time_up_1';} //----------------------------------------------------------------------------------------------- else if ((Last_Sort_ID == '646E6563736544435174726F53676E69') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_name_down_2';} else if ((Last_Sort_ID == '69646E6563734143464974726F53676E') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_name_up_2';} else if ((Last_Sort_ID == '646E6563736544436B74726F53676E69') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_size_down_2';} else if ((Last_Sort_ID == '69646E6563734143604974726F53676E') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_size_up_2';} else if ((Last_Sort_ID == '646E6563736544435F74726F53676E69') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_time_down_2';} else if ((Last_Sort_ID == '69646E6563734143544974726F53676E') && (TreeID == Tree_1_ID)) {Last_Sort_Info = 'Sort_by_time_up_2';} //----------------------------------------------------------------------------------------------- else if ((Last_Sort_ID == '646E6563736544434374726F53676E69')) {Last_Sort_Info = 'Sort_by_winner_down';} else if ((Last_Sort_ID == '69646E6563734143744974726F53676E')) {Last_Sort_Info = 'Sort_by_winner_up';} //----------------------------------------------------------------------------------------------- if (Sort_Type == 'name_1') { if (Last_Sort_Info != 'Sort_by_name_up_1') New_Sort_Info = 'Sort_by_name_up_1'; else New_Sort_Info = 'Sort_by_name_down_1'; } if (Sort_Type == 'name_2') { if (Last_Sort_Info != 'Sort_by_name_up_2') New_Sort_Info = 'Sort_by_name_up_2'; else New_Sort_Info = 'Sort_by_name_down_2'; } //----------------------- if (Sort_Type == 'size_1') { if (Last_Sort_Info != 'Sort_by_size_up_1') New_Sort_Info = 'Sort_by_size_up_1'; else New_Sort_Info = 'Sort_by_size_down_1'; } if (Sort_Type == 'size_2') { if (Last_Sort_Info != 'Sort_by_size_up_2') New_Sort_Info = 'Sort_by_size_up_2'; else New_Sort_Info = 'Sort_by_size_down_2'; } //----------------------- if (Sort_Type == 'time_1') { if (Last_Sort_Info != 'Sort_by_time_up_1') New_Sort_Info = 'Sort_by_time_up_1'; else New_Sort_Info = 'Sort_by_time_down_1'; } if (Sort_Type == 'time_2') { if (Last_Sort_Info != 'Sort_by_time_up_2') New_Sort_Info = 'Sort_by_time_up_2'; else New_Sort_Info = 'Sort_by_time_down_2'; } //----------------------- if (Sort_Type == 'winner') { if (Last_Sort_Info != 'Sort_by_winner_up') New_Sort_Info = 'Sort_by_winner_up'; else New_Sort_Info = 'Sort_by_winner_down'; } //----------------------- G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].sort = New_Sort_Info; //----------------------- var AssocObj = external.ObjByID(G_ActiveAssocID); var SuperTreeList = AssocObj.GetM('m_SuperTreesPtr'); var SuperTree_Obj = SuperTreeList.GetFirst(); var Tree_0_ID = SuperTree_Obj.objID; SuperTree_Obj = SuperTreeList.GetNext(SuperTree_Obj); var Tree_1_ID = SuperTree_Obj.objID; //------------------------------------------------------------------------------------------------------------------ if ((New_Sort_Info == 'Sort_by_name_down_1')) {New_Sort_ID = '646e6563736544435174726f53676e69'; TreeID = Tree_0_ID;} else if ((New_Sort_Info == 'Sort_by_name_up_1')) {New_Sort_ID = '69646e6563734143464974726f53676e'; TreeID = Tree_0_ID;} else if ((New_Sort_Info == 'Sort_by_size_down_1')) {New_Sort_ID = '646e6563736544436b74726f53676e69'; TreeID = Tree_0_ID;} else if ((New_Sort_Info == 'Sort_by_size_up_1')) {New_Sort_ID = '69646e6563734143604974726f53676e'; TreeID = Tree_0_ID;} else if ((New_Sort_Info == 'Sort_by_time_down_1')) {New_Sort_ID = '646e6563736544435f74726f53676e69'; TreeID = Tree_0_ID;} else if ((New_Sort_Info == 'Sort_by_time_up_1')) {New_Sort_ID = '69646e6563734143544974726f53676e'; TreeID = Tree_0_ID;} //------------------------------------------------------------------------------------------------------------------- else if ((New_Sort_Info == 'Sort_by_name_down_2')) {New_Sort_ID = '646e6563736544435174726f53676e69'; TreeID = Tree_1_ID;} else if ((New_Sort_Info == 'Sort_by_name_up_2')) {New_Sort_ID = '69646e6563734143464974726f53676e'; TreeID = Tree_1_ID;} else if ((New_Sort_Info == 'Sort_by_size_down_2')) {New_Sort_ID = '646e6563736544436b74726f53676e69'; TreeID = Tree_1_ID;} else if ((New_Sort_Info == 'Sort_by_size_up_2')) {New_Sort_ID = '69646e6563734143604974726f53676e'; TreeID = Tree_1_ID;} else if ((New_Sort_Info == 'Sort_by_time_down_2')) {New_Sort_ID = '646e6563736544435f74726f53676e69'; TreeID = Tree_1_ID;} else if ((New_Sort_Info == 'Sort_by_time_up_2')) {New_Sort_ID = '69646e6563734143544974726f53676e'; TreeID = Tree_1_ID;} //----------------------------------------------------------------------------------------------- else if (New_Sort_Info == 'Sort_by_winner_down') {New_Sort_ID = '646e6563736544434374726f53676e69';} else if (New_Sort_Info == 'Sort_by_winner_up' ) {New_Sort_ID = '69646e6563734143744974726f53676e';} //----------------------------------------------------------------------------------------------- msgs.Method2('M_SetSortingCriterion', New_Sort_ID, TreeID); //msgs.Method1('M_SetFirstVisibleMessageByIndex', 0); G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); //----------------------------------------------------------------------------------------------- } function ExtRedrawCollection(CollectionID) { G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); } //--------------------------------------------------------------------------------------------------------- // DHTML Library //--------------------------------------------------------------------------------------------------------- // Global variables var isCSS, isW3C, isIE4, isNN4, isIE6CSS; // Initialization after loading function initDHTMLAPI() //Ok { if (document.images) { isCSS = (document.body && document.body.style ) ? true : false; isW3C = (isCSS && document.getElementById ) ? true : false; isIE4 = (isCSS && document.all ) ? true : false; isNN4 = (document.layers ) ? true : false; isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >=0 ) ? true : false; } } // function seekLayer(doc, name) { var theObj; for (var i = 0; i < doc.layers.length; i++) { if (doc.layers.name == name) { theObj = doc.layers[i]; break; } } if (doc.layers[i].document.layers.length > 0) { theObj = seekLayer(document.layers[i], document.name); } return theObj; } // function getRawObject(obj) { var theObj; if (typeof obj == "string") { if (isW3C) theObj = document.getElementById(obj); else if (isIE4) theObj = document.all(obj); else if(isNN$) theObj = seekLayer(document, obj); } else theObj = obj; return theObj; } // function getObject(obj) { var theObj = getRawObject(obj); if (theObj && isCSS) { theObj = theObj.style; } return theObj; } // function shiftTo(obj, x, y) { var theObj = getObject(obj); if (theObj) { if (isCSS) { var units = (typeof theObj.left == "string") ? "px" : 0; theObj.left = x + units; theObj.top = y + units; } else if (isNN4) theObj.moveTo(x,y); } } // function shiftBy(obj, deltaX, deltaY) { var theObj = getObject(obj); if (theObj) { if (isCSS) { var units = (typeof theObj.left == "string") ? "px" : 0; theObj.left = getObjectLeft(obj) + deltaX + units; theObj.top = getObjectTop(obj) + deltaY + units; } else if (isNN4) theObj.moveBy(deltaX, deltaY); } } // function setZIndex(obj, zOrder) { var theObj = getObject(obj); if (theObj) theObj.zIndex = zOrder; } // function setBGColor(obj, color) { var theObj = getObject(obj); if (theObj) { if (isNN4) theObj.bgColor = color; else if (isCSS) theObj.backgroundColor = color; } } // function show(obj) { var theObj = getObject(obj); if (theObj) { theObj.visibility = "visible"; } } // function hide(obj) { var theObj = getObject(obj); if (theObj) { theObj.visibility = "hidden"; } } // function getObjectLeft(obj) { var elem = getRawObject(obj); var result = 0; if (document.defaultView) { var style = document.defaultView; var cssDecl = style.getComputedStyle(elem, ""); result = cssDecl.getPropertyValue("left"); } else if (elem.currentStyle) result = elem.currentStyle.left; else if (elem.style) result = elem.style.left; else if (isNN4) result = elem.left; return parseInt(result); } // function getObjectTop(obj) { var elem = getRawObject(obj); var result = 0; if (document.defaultView) { var style = document.defaultView; var cssDecl = style.getComputedStyle(elem, ""); result = cssDecl.getPropertyValue("top"); } else if (elem.currentStyle) result = elem.currentStyle.top; else if (elem.style) result = elem.style.top; else if (isNN4) result = elem.top; return parseInt(result); } // function getObjectWidth(obj) { var elem = getRawObject(obj); var result = 0; if (elem.offsetWidth) result = elem.offsetWidth; else if (elem.clip && elem.clip.width ) result = elem.clip.width; else if (elem.style && elem.style.pixelWidth) result = elem.style.pixelWidth; return parseInt(result); } // function getObjectHeight(obj) { var elem = getRawObject(obj); var result = 0; if (elem.offsetHeight) result = elem.offsetHeight; else if (elem.clip && elem.clip.height) result = elem.clip.height; else if (elem.style && elem.style.pixelHeight) result = elem.style.pixelHeight; return parseInt(result); } // function getInsideWindowWidth() { if (window.innerWidth) return window.innerWidth; else if (isIE6CSS) return document.body.parentElement.clientWidth; else if(document.body && document.body.clientWidth) return document.body.clientWidth; return 0; } // function getInsideWindowHeight() { if (window.innerHeight) return window.innerHeight; else if (isIE6CSS) return document.body.parentElement.clientHeight; else if(document.body && document.body.clientWidth) return document.body.clientHeight; return 0; } //--------------------------------------------------------------------------------------------------------- // DRAGIMAGE Library //--------------------------------------------------------------------------------------------------------- // Global variables var selectedObj; var containerObj; var offsetX; var offsetY; var BarX, BarY; var msgIndex = null; var BarHeight, ContainerHeight; var firstElement; function setSelectedElem(evt) { var target = (evt.target)? evt.target : evt.srcElement; //------------------------------------------ var divID = (target.name && target.src) ? target.name + "Wrap" :''; if (divID) { selectedObj = document.getElementById(divID); setZIndex(selectedObj, 100); var ContainerDivID = divID + 'Container'; if (ContainerDivID) containerObj = document.getElementById(ContainerDivID); return; } //------------------------------------------ // page block //------------------------------------------ divID = (target.collectionID) ? target.id :''; if (divID) { var Obj = document.getElementById(target.collectionID + 'BarWrap'); if (Obj.offsetTop < evt.offsetY) go_next_page(target.collectionID); else go_prev_page(target.collectionID); return; } //------------------------------------------ containerObj = null; selectedObj = null; return; } //------------------------------------------------------------------------------------------ function engage(evt) { evt = (evt) ? evt: event; setSelectedElem(evt); if (selectedObj) { document.body.setCapture(); offsetX = evt.clientX - ((selectedObj.offsetLeft) ? selectedObj.offsetLeft : 0); offsetY = evt.clientY - ((selectedObj.offsetTop ) ? selectedObj.offsetTop : 0); return false; } } //------------------------------------------------------------------------------------------ var latch = false; function dragIt(evt) { evt = (evt) ? evt : event; var x, y, width, height; if (selectedObj) { G_Collection_lock = true; selectedObj.innerHTML='<image src="Pics/ScrBar_moved.gif">'; x = evt.clientX - offsetX; y = evt.clientY - offsetY; width = getObjectWidth(selectedObj); height = getObjectHeight(selectedObj); container_width = getObjectWidth(containerObj); container_height = getObjectHeight(containerObj); BarHeight = height; ContainerHeight = container_height; x = (x < 0) ? 0 : ((x + width > container_width ) ? container_width - width : x); y = (y < 0) ? 0 : ((y + height > container_height) ? container_height - height : y); shiftTo(selectedObj, x, y); BarX = x; BarY = y; //---------------------------------- var CollectionID = selectedObj.collectionID; var CollectionElement = document.getElementById(CollectionID); var CollectionHeadElement = document.getElementById(CollectionID + '_in'); if (latch == false) { //---------------------------------------------------------------------------------- var AssocElement = document.getElementById('Assoc_'+G_ActiveAssocID); var collection_container = AssocElement.all[CollectionID+'_container']; if(collection_container != null) { i = 0; if (collection_container.children(i) != null) { while (collection_container.children(i)) { collection_container.children(i).className = 'Msg_Even'; i++; } } } //----------------------------------------------------------------------------------- latch = true; } var collection = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID]; if (collection) { var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj;} else { var msgs = null;} if(msgs != null) { var factor = y/(container_height - height); //alert('factor=' + factor); var counter_value = msgs.Method0('M_GetCount'); var new_first_message_element_number = Math.round(factor * (counter_value - CONST_MESSAGES_ON_PAGE)); //alert(new_first_message_element_number); //------------------------------------------ msgIndex = new_first_message_element_number; firstElement = msgs.Method1('M_GetIDMessageByIndex', new_first_message_element_number); // 0..counter_value-1 } //---------------------------------- evt.cancelBubble = true; return false; } } //------------------------------------------------------------------------------------------ function release(evt) { if (selectedObj) { var CollectionID = selectedObj.collectionID; var collection = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID]; if (collection) { var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj;} else { var msgs = null;} if ((msgs) && (msgIndex)) msgs.method1('M_SetFirstVisibleMessageByIndex', msgIndex); else msgs.method1('M_SetFirstVisibleMessageByIndex', 0); var CollectionID = selectedObj.collectionID; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); setZIndex(selectedObj, 0); document.body.releaseCapture(); firstElement = null; selectedObj = null; latch = false; msgIndex = null; G_Collection_lock = false; } } //------------------------------------------------------------------------------------------ function initDrag() { document.onmousedown = engage; document.onmousemove = dragIt; document.onmouseup = release; document.onmousewheel = scrollIt; return; } //------------------------------------------------------------------------------------------ var wheel_lock = false; function scrollIt(CollectionID) { //----------------------------------- if (wheel_lock == true) return false; //----------------------------------- event.cancelBubble = false; if (!G_Assocs[G_ActiveAssocID]) return true; if (!G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID]) return true; if (G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj) var collection_message_list = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; else return true; wheel_lock = true; event.cancelBubble = true; var message_counter_value = collection_message_list.Method0('M_GetCount'); var items_per_page = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); if (message_counter_value > items_per_page) { var collection_node = G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]; var first_msg_index = collection_message_list.Method0('M_GetFirstVisibleMessageIndex'); //---------------------------------------------------------------------------------------------------------------------------------------- if ((event.wheelDelta > 0) && (first_msg_index > 0) && (collection_node._expanded == true)) { go_prev_message(CollectionID); wheel_lock = false; return false; } else if ((event.wheelDelta < 0) && (first_msg_index < message_counter_value - items_per_page) && (collection_node._expanded == true)) { go_next_message(CollectionID); wheel_lock = false; return false; } else { wheel_lock = false; return true; } //---------------------------------------------------------------------------------------------------------------------------------------- } else { wheel_lock = false; return true; } } //---------------------------------------------------------------------------------------- // defines states of scrollbar elements //---------------------------------------------------------------------------------------- function AutoRefreshScrollers(AssocID, CollectionID) { //---------------------------------------------------------------------------------------- if (G_Collection_lock == true) return; //---------------------------------------------------------------------------------------- if (G_Assocs[AssocID] == null) return; if (G_Assocs[AssocID].TreeView == null) return; if (G_Assocs[AssocID].TreeView._collections[CollectionID] == null) return; var msgs = G_Assocs[AssocID].TreeView._collections[CollectionID].obj; if (msgs == null) return; //---------------------------------------------------------------------------------------- var msgs_count = msgs.Method0('M_GetCount'); var msgs_per_page = external.Method1('M_GetGlobalOption', 'ItemsPerPage'); //---------------------------------------------------------------------------------------- var first_msg = msgs.GetFirst(); var last_msg = msgs.GetLast(); if ((first_msg != null) && (last_msg != null)) { var first_msg_id = first_msg.objID; var last_msg_id = last_msg.objID; } else return; //---------------------------------------------------------------------------------------- var msg = msgs.Method0('M_GetFirstVisibleMessage'); var firstVisibleMsgID=''; if (msg != null) firstVisibleMsgID = msg.objID; var lastVisibleMsgID =''; if (msg != null) lastVisibleMsgID = msg.objID; while (msg != null) { msg = msgs.Method1('M_GetNextVisibleMessage', msg); if (msg != null) { lastVisibleMsgID = msg.objID;} } //---------------------------------------------------------------------------------------- if (msgs_per_page < msgs_count) { var MsgScrollersExist = true; //--------------------------------------------------------- if (first_msg_id == firstVisibleMsgID) var prev_state = false; else var prev_state = true; //--------------------------------------------------------- if (last_msg_id == lastVisibleMsgID) var next_state = false; else var next_state = true; //--------------------------------------------------------- } else { var MsgScrollersExist = false; var prev_state = false; var last_state = false; } //---------------------------------------------------------------------------------------- var assoc_element = document.getElementById('Assoc_'+AssocID); RefreshMsgScrollers(assoc_element, "prev", prev_state, CollectionID, MsgScrollersExist); RefreshMsgScrollers(assoc_element, "next", next_state, CollectionID, MsgScrollersExist); } //---------------------------------------------------------------------------------------------------------- // //---------------------------------------------------------------------------------------------------------- function ExtRemoveMsg(MsgCollectionObjID, MsgObjID) { if (G_Collection_lock == true) return; if((G_Above_message.msg_id == MsgObjID) && (G_Above_message.collection_id == MsgCollectionObjID)) G_Above_message.mustshown = false; G_Shown_message.collection_id = null; G_Shown_message.msg_id = null; //------------------------------------ var msg = external.ObjByID(MsgObjID); if(msg == null) return; //------------------------------------ var AssocID = msg.GetM('m_SlnDoAssocSyncWPtr').objID; if(G_Assocs[AssocID].TreeView._collections[MsgCollectionObjID] == null) return; //------------------------------------ var collection_container = document.getElementById('Assoc_'+AssocID).all[MsgCollectionObjID+'_container']; if (collection_container.children == null) return; //--------------------------------------------------------------- var message_element = collection_container.children[MsgObjID]; if(message_element == null) return; else if(message_element.exist == 'false') return; //--------------------------------------------------------------- if(message_element.className.match(/Msg_Odd/)) MsgEvenness = 1; else MsgEvenness = 0; ChangeMessageIntoRemovedObject(message_element, MsgCollectionObjID, MsgObjID, MsgEvenness); } //---------------------------------------------------------------------------------------------------------- // //---------------------------------------------------------------------------------------------------------- function ChangeMessageIntoRemovedObject(message_tbody_element, CollectionID, MessageID, MsgEvenness) { message_tbody_element.id = MessageID; message_tbody_element.className = 'Msg_Removed'; message_tbody_element.oncontextmenu = 'return;' for(i in message_tbody_element.children) { if (i.onclick) i.onclick='return;'; if (i.onmouseleave) i.onmouseleave='return;'; if (i.onmouseenter) i.onmouseenter='return;'; } } function ExtUpdateAfterRemove(CollectionID) { var collection_container_element = document.getElementById(CollectionID+'_container'); if (collection_container_element == null) return; var collection_container_length = collection_container_element.children.length; //alert(collection_container_length); //---------------------------------------------------------------------------------------- var msgs = G_Assocs[G_ActiveAssocID].TreeView._collections[CollectionID].obj; var msgs_count = msgs.Method0('M_GetCount'); //alert(msgs_count); //---------------------------------------------------------------------------------------- if (msgs_count == 0) { var collection_node = G_Assocs[G_ActiveAssocID].TreeView.root._children[CollectionID]; collection_node._empty = true; G_Assocs[G_ActiveAssocID].TreeView.redraw_collection(CollectionID); return; } //---------------------------------------------------------------------------------------- var msg = msgs.Method0('M_GetFirstVisibleMessage'); var msgID = msg.objID; var i = 0; //---------------------------------------------------------------------------------------- while ((msg != null) && (i < collection_container_length)) { if (collection_container_element.children(i).id != msgID) { var message_element = collection_container_element.children(i); var MsgEvenness = 1; BuildMessageAsObject(message_element, CollectionID, msgID, MsgEvenness); } msg = msgs.Method1('M_GetNextVisibleMessage', msg); if (msg != null) msgID = msg.objID; i++; } //---------------------------------------------------------------------------------------- if (msg == null) { while(collection_container_element.children(i)) { message_container_element = collection_container_element.children(i); message_container_element.removeNode(true); } } else { while (msg != null) { var Assoc = msg.GetM('m_SlnDoAssocSyncWPtr'); var AssocID = Assoc.objID; if(G_Assocs[AssocID].TreeView._collections[MsgCollectionObjID] != null) G_Assocs[AssocID].TreeView.add_message_node(MsgCollectionObjID, MsgObjID, -1); msg = msgs.Method1('M_GetNextVisibleMessage', msg); msgID = msg.objID; } } //---------------------------------------------------------------------------------------- i = 0; var MsgEvenness = 1; while (collection_container_element.children(i)) { if(MsgEvenness == 0) collection_container_element.children(i).className = 'Msg_Even'; else collection_container_element.children(i).className = 'Msg_Odd'; MsgEvenness = 1 - MsgEvenness; i++; } //---------------------------------------------------------------------------------------- AutoRefreshScrollers(AssocID, CollectionID); //---------------------------------------------------------------------------------------- }